npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

kxkj-common1

v0.0.26-5

Published

This template should help get you started developing with Vue 3 in Vite. 是基于vue3项目,对element-plus及vxe-table进行的二次封装.

Downloads

9

Readme

kxkj-common

This template should help get you started developing with Vue 3 in Vite. 是基于vue3项目,对element-plus及vxe-table进行的二次封装.

使用方式

1. 安装kxkj-common:npm install --save kxkj-common@对应版本号-如不带则下载最新版本

npm install --save kxkj-common

2. main.js 引用

import { createApp } from "vue";
import App from "./App.vue";
import kxkjCommon from 'kxkj-common'
import "kxkj-common/dist/style.css"

let app = createApp(App);

app.use(kxkjCommon);
app.mount("#app");

3. 页面中使用kxkjCommon组件:表格 KxVxTable

<template>
	<KxVxTable
		:tableData="tableData"
        :total="total"
        :tableConfig="tableConfig"
        :loading="loading"
        placeholder="员工姓名"
        @search="getPageList"
        @clear="getPageList"
        v-model:pageNum="pageRequest.pageNum"
        v-model:pageSize="pageRequest.pageSize"
        v-model:uname="queryParam.uname"
    >
	</KxVxTable>
</template>

属性

| 名称 | 说明 | 类型 | 默认 | | ---------------- | -------------------------------------- | ------- | ---------- | | tableData | 表格数据 | Array | | | tableConfig | 表格配置项(表头,权限,导入导出配置) | Object | | | loading | 表格加载数据的过渡效果 | Boolean | | | placeholder | 默认搜索框提示内容 | String | 关键字名称 | | v-model:uname | 默认搜索参数 | String | | | total | 数据总数 | Number | | | v-model:pageNum | 当前页数 | Number | 1 | | v-model:pageSize | 每页显示条目个数 | Number | 15 | | showRadio | 是否显示单选框 | Boolean | false | | showSelCheckbox | 是否显示多选框 | Boolean | false | | checkBoxConfig | 单选框配置项 | Object | |

事件

| 名称 | 说明 | | --------------- | ------------------ | | search | 点击搜索按钮时触发 | | clear | 点击重置按钮时触发 | | checkbox-change | 复选框改变时触发 | | select-all | 复选框全选时触发 | | cell-click | 单元格点击时触发 |

插槽

| 插槽名 | 说明 | | -------- | ------------------ | | add | 搜索栏前面按钮区域 | | search | 搜索栏本体 | | toolSlot | 搜索栏尾部按钮区域 | | btn | 表格列操作区域 |

4. 页面中使用kxkjCommon组件:左侧树 KxSelTree

<template>
	<KxSelTree
      :catalogTree="TreeData"
      :defaultCheckedKeys="defaultCheckedKeys"
      :defaultLevel="defaultOpenLevel"
      @transfer="getCurrNodeInfo"
      :defaultProps="defaultProps"
      cardStyle
      cardTitle="标题"
    >
    	<template #viewdata></template>
	</KxSelTree
</template>

属性

| 名称 | 说明 | 类型 | 默认 | | ------------------ | ---------------------------------------------------- | ------- | ---- | | catalogTree | 树显示的数据 | Array | | | defaultCheckedKeys | 默认选中数据 | Array | | | defaultLevel | 默认展开数据 | Array | | | defaultProps | 配置数据 | Object | | | placeholderName | 树搜索关键字 | String | | | nodeKey | 每个树节点用来作为唯一标识的属性,整棵树应该是唯一的 | String | | | emptyText | 内容为空的时候展示的文本 | String | | | isRightView | 判断是否需要右侧的视图 | Boolean | | | cardStyle | 是否需要卡片样式 | Boolean | | | cardTitle | 卡片样式下树的标题 | String | | | hasOperation | 树书否需要编辑、删除操作 | Boolean | |

事件

| 事件名 | 说明 | 参数 | | -------- | -------------------- | -------------- | | refresh | 刷新树数据 | | | transfer | 节点点击回调 | data:节点数据 | | edit | 节点点击编辑按钮回调 | data:节点数据 | | delete | 节点点击删除按钮回调 | data:节点数据 |

5.页面中使用kxkjCommon组件:表单 KxForm【有副作用待优化】

<template>
	<KxForm tableName="表单名称" :state="表单状态" :sendInfo="sendInfo"  @handleSuccess="handleSuccess">
</template>

属性

| 名称 | 说明 | 类型 | 默认 | | ---------- | ------------------------------ | ------- | ---------------------- | | tableName | 表单名称 | String | | | state | 表单状态 | String | 新增-编辑-预览,默认无 | | sendInfo | 外部传进来需要与表单合并的数据 | Object | | | infoKey | 表单主键名称 | String | uid | | infoId | 表单主键值 | String | | | isFooter | 是否需要操作按钮 | Boolean | false | | divUrl | 请求地址前缀 | String | | | adjustable | 外部提交 | Boolean | false | | isLabel | 表单是否已文本形式显示 | Boolean | false |

事件

| 事件名 | 说明 | 参数 | | -------------- | -------------------------- | ------------------------------------ | | handleSuccess | 外部提交和自动提交成功回调 | res:接口调用结果,info Form:表单数据 | | initSuccess | 调用info接口完成后回调 | data:接口返回的data数据 | | initMustChoice | 必录项初始化完毕 | ruleRequireList:必录项信息点数据 |

6.页面中使用kxkjCommon组件:权限按钮 KxButton【有副作用待优化】

<template>
	<KxButton label="删除" :perms="权限名称" type="primary" @click="点击事件" />
</template>

属性

| 名称 | 说明 | 类型 | 默认 | | ------------------------------ | -------- | ------ | ---- | | label | 按钮文本 | String | | | perms | 权限名称 | String | | | 其他的参考element-plus按钮属性 | | | |

插槽

| 名称 | 说明 | | ----- | ------------ | | label | 按钮文本插槽 |

7.页面中使用kxkjCommon组件:弹窗 KxDialog \ 抽屉 KxDrawer

<template>
    <KxDialog v-model:isShow="showMoreSelect" dialogName="弹窗名字" state="浏览" :isShowState="false" dialogWidth="50%">
      <template #content>
        弹窗内容
      </template>
    </KxDialog>

	<KxDrawer v-model:isShow="showMoreSelect" dialogName="抽屉名字" state="浏览" :isShowState="false" dialogWidth="50%">
      <template #content>
        抽屉内容
      </template>
    </KxDrawer>
</template>

属性

| 名称 | 说明 | 类型 | 默认 | | ----------------- | -------------------------- | ------- | ---------------------- | | v-model:isShow | 显示隐藏 | Boolean | false | | dialogName | 名字 | String | | | appendBody | 自身是否插入至 body 元素上 | Boolean | false | | dialogWidth | 表格宽度 | String | 30% | | state | 弹窗、抽屉状态 | String | 新增-预览-编辑,默认无 | | isShowState | 是否显示状态信息 | Boolean | true | | isFooter | 是否需要按钮 | Boolean | true | | confirmButtonText | 提交按钮名称 | String | 保存 | | customerFooter | 是否自定义按钮 | Boolean | false | | loading | 加载动画 | Boolean | false |

插槽

| 名称 | 说明 | | ------- | -------------- | | content | 弹窗、抽屉内容 | | operate | 自定义按钮区域 |

事件

| 事件名称 | 说明 | | -------- | ------------------ | | onSubmit | 点击保存按钮回调 | | onCancel | 关闭弹窗、抽屉回调 |