table-edit
v1.1.0
Published
```js <template> <edit :title="title" :list="list" :edit="save" /> </template>
Downloads
12
Readme
安装
vue-cli element-ui
npm i table-edit --save
how to use
<template>
<edit :title="title" :list="list" :edit="save" />
</template>
<script>
import edit from 'table-edit'
export default {
components: { edit },
data() {
/**
* @param {Array} title 表格标题
* @param {Object} list 单元格数据数据
* @param {Object} row 当前行的数据
*/
return {
title: {
name: '姓名',
date: '时间',
address: '地址'
},
list: [
{
date: '2016-05-03',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-02',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}, {
date: '2016-05-04',
name: '王小虎',
address: '上海市普陀区金沙江路 1518 弄'
}]
}
},
methods: {
save(row) {
console.log(row)
}
}
}
</script>