vue-table-assembly
1.1.25 • Public • Published project-name
Project setup
yarn install
Compiles and hot-reloads for development
yarn serve
Compiles and minifies for production
yarn build
Lints and fixes files
yarn lint
Customize configuration
See Configuration Reference.
使用方式:
npm安装vue-TableAssembly组件main.js中全局注册。
注意:需引入elementUi的相关的组件及css样式。
组件使用:
传入数据:
tableData: 表格行数据(Array)
tableColumns: 表格列数据(Array)
page: 分页数据(Object)
tableSelection: 是否在每一行数据前加上选框(Boolean)
Table 事件等绑定与elementUi的api ,methods、events、Attributes、
Slot等使用基本一致。
Table-column传入数据:
label:该列的列名(String),
width:该列长度(String),
prop:字段名(String),在tabelList中对应该字段,赋予相应的值
sortable: 是否排序(Boolean),
index: 自定义排序(基本类型),
filters: 自定义过滤的数组(Array),
type: 设置类型selection/index/expand(String),
其余参照element 的api使用,传的key全部以驼峰命名法命名。
在table-column中若需传入函数不要传函数名的字符串!
自定义表格内容需在Table-column传入数据中使用 slotName :xxx 命名要使用的slot,方可在组件内使用具名插槽。在具名插槽上加上 slot-scope=”xxx”属性,便可使用作用域插槽,使用” xxx.data “ 获取传入插槽的数据。否则会展示默认数据。
pageConfigure 传入数据:
currentPage: 当前页,
size: 每一页多少条数据,
total: 数据总条数,
pageShow:是否展示分页,
其余依旧按照elementUi的api来^_^
新增功能,如果不想让某一行展示slot的内容可使用slot=false的方式来隐藏该slot
功能新增:tableSelection:多选框类型自定/默认多选框
tableSelection:{
show: true,
type:'index',
label:'序号',
width:'60'
}
<VueTableAssembly tableSelection="tableSelection"></VueTableAssembly>
Readme
Keywords
nonePackage Sidebar
Install
Weekly Downloads