update 字典数据在表格中编辑

This commit is contained in:
2021-05-19 14:19:43 +08:00
parent c72983f125
commit 0f8d6191e5
3 changed files with 111 additions and 142 deletions

View File

@@ -159,7 +159,18 @@ export default {
onResetQuery() {
this.$emit('resetQuery')
this.$emit('reset-query')
}
},
onAddRow(row = {}) {
if (!this.data.find(p => !p.id))
this.data.push(row)
},
onDeleteRow(row) {
if (row && this.data.indexOf(row) > -1) {
this.data.splice(this.data.indexOf(row), 1)
}
},
},
render() {
@@ -171,7 +182,8 @@ export default {
bordered: true,
size: 'middle',
rowKey: record => record.id || Math.random().toString(16).slice(2),
scroll: { x: 'max-content' }
scroll: { x: 'max-content' },
...this.$attrs
}
const on = {