在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
开源软件名称:MoTable开源软件地址:https://gitee.com/zhuzhaofeng/MoTable开源软件介绍:Mo Table安装所需依赖npm install @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props --save-dev# orcnpm install @vue/babel-preset-jsx @vue/babel-helper-vue-jsx-merge-props --save-dev 使用
import MoTable from 'path/MoTable'; <MoTable :data="" :col="" {...} /> Attributes 属性data
<MoTable :data="tabelData" /> export default { name: "App", components: { MoTable }, data() { return { tableData: [ { date: "2020-03-27", name: "老村长", address: "四川省成都市青羊区人民中路一段16号" }, { date: "2020-03-27", name: "老村长", address: "四川省成都市青羊区人民中路一段16号" }, { date: "2020-03-27", name: "老村长", address: "四川省成都市青羊区人民中路一段16号" }, { date: "2020-03-27", name: "老村长1", address: "四川省成都市青羊区人民中路一段16号" } ] }; }}; cols
<MoTable :cols="cols" /> export default { name: "App", components: { MoTable }, data() { return { cols: [ { align: "center", type: "index" }, { align: "center", type: "selection" }, { prop: "date", label: "日期", width: "180" }, { prop: "name", label: "姓名", width: "180" }, { prop: "address", label: "地址" }, { label: "操作", align: "center", width: "140", scopedSlots: { default: scoped => { return ( <el-button onClick={() => this.handlerEditor(scoped.row) } type="primary" plain size="small" icon="el-icon-edit" > Editor </el-button> ); } } } ] }; }, methods: { handlerEditor(row) { console.log(row) } }}; attrs
<MoTable :attrs="tableAttrs" /> export default { name: "App", components: { MoTable }, data() { return { tableAttrs: { stripe: true, border: true, "show-header": true, data: [ { date: "2020-03-27", name: "老村长", address: "四川省成都市青羊区人民中路一段16号" }, { date: "2020-03-27", name: "老村长", address: "四川省成都市青羊区人民中路一段16号" }, { date: "2020-03-27", name: "老村长", address: "四川省成都市青羊区人民中路一段16号" }, { date: "2020-03-27", name: "老村长", address: "四川省成都市青羊区人民中路一段16号" } ] } }; }}; events
<MoTable :events="tableEvents" /> export default { name: "App", components: { MoTable }, data() { return { tableEvents: { "row-click": (row, column, event) => { console.log(row); console.log(column); console.log(event); } } }; }}; paging
<MoTable :paging="pagingAttrs" /> export default { name: "App", components: { MoTable }, data() { return { pagingAttrs: { currentPage: 1, pageSizes: [10, 20, 30, 40, 50], pageSize: 0, layout: "total, sizes, prev, pager, next, jumper", total: 4 } }; }}; pagingEvents
<MoTable :pagingEvents="pagingEvents" /> export default { name: "App", components: { MoTable }, data() { return { pagingEvents: { sizeChange: () => {}, currentChange: () => {} } }; }}; |
请发表评论