guesswhy-reaper-table
···
⬇️ Install
npm install guesswhy-reaper-table
🎨 Usage
main.js
import ReaperTable from 'guesswhy-reaper-table'
Vue.use(ReaperTable)
<reaper-table :tableData="tableData" :columns="columns"></reaper-table>
tableData: [
{id:1, a:2, b:3, c:4},
{id:1, a:2, b:3, c:4},
{id:1, a:2, b:3, c:4},
{id:1, a:2, b:3, c:4},
]
columns: [
{ title: "列标题", field: "列填充字段" },
{ title: "列标题", field: "列填充字段" },
{ title: "列标题", field: "列填充字段" },
{
title: "列标题",
field: "列填充字段",
type: "switch",
payload: {open:true,close:false,change: row=>console.log(row)}
},
{
title: "列标题",
field: "列填充字段",
width: 300,
fixed: 'right',
type: "btn",
payload: [
{
name: "修改用户",
type: "primary",
click: (row) => console.log("修改", row),
},
{
name: "分配角色",
type: "success",
click: (row) => console.log("分配角色", row),
},
{
name: "删除",
type: "danger",
click: (row) => console.log("删除", row),
},
]
},
]
💡 Compiles and minifies for production
具体使用要搭配element组件全局引入element库搭配一起使用,否则不生效
Show
License
### 🔒 License
See [Configuration Reference](https://cli.vuejs.org/config/).