1.1.2 • Published 3 years ago

khari-component v1.1.2

Weekly downloads
-
License
-
Repository
-
Last release
3 years ago

kolor-element-ui

基于vue2+ 使用jsx二次封装element-ui的业务组件,通过全数据配置方式生成视图

Project setup

npm install / yarn

Compiles and hot-reloads for development

npm run serve / yarn serve / yarn start

Compiles and minifies for production

npm run build / yarn build

Lints and fixes files

npm run lint 

Customize configuration

See Configuration Reference.

KolorTable组件 Attributes

根容器为el-table组件,组件的Attributes除了以下新增的之外,还支持所有el-table的Attributes

新增参数说明类型可选值默认值
data表格数据对象Array--
columns单元格数据对象(用于渲染)Array全部为el-table-column的Attributes-
show-pagination是否展示分页器booleanfalse/truetrue
pagination分页配置Object全部为el-pagination的Attributes-

KolorTable组件 Events

除了下面新增的events之外,还支持所有el-table的events

事件名说明返回值
page-change监听分页变化,映射 组件的所有事件{ currentPage, pageSize }

父组件访问el-table组件实例

<ko-table 
  :data="tableData" 
  :columns="columns" 
  :border="true" 
  :pagination="pagination"
  :show-pagination="true"
  @page-change="pageChange"
  @row-click="rowClick"
  stripe
  ref="kolorTable"
/>

...

this.$refs.multipleTable.ElTable();

// 拿到实例时候,可以执行所有官方el-table的Methods

// 例: 用于多选表格,清空用户的选择  其余Methods查看element-ui官方文档 

<[链接地址](https://element.eleme.cn/#/zh-CN/component/table#table-methods)>

this.$refs.multipleTable.ElTable().clearSelection();

KolorQueryFormJsx 组件 Attributes

根容器为el-form组件,组件的Attributes除了以下新增的之外,还支持所有el-form的Attributes和事件

新增参数说明类型可选值默认值
v-model表单的双向绑定值object--
formItems表单的数据对象(用于渲染)FormItem[]-[]

FormItem数据结构

键名说明类型可选值
type表单项类型stringselect
itemLists当type为'select'时传,下拉框列表ItemList[]-
其余参数全部为组件的prop---

ItemList数据结构

键名说明类型可选值
prop下拉框v-model绑定值的字段名string-
dataLists下拉框option的数据对象any[]any还可为的所有prop
formatDataKey格式化dataLists中绑定到上面的label和value字段object-
其余参数全部为组件的prop---