File tree 1 file changed +2
-4
lines changed
1 file changed +2
-4
lines changed Original file line number Diff line number Diff line change @@ -14,7 +14,7 @@ Table with editable cells.
14
14
<a-button class =" editable-add-btn" @click =" handleAdd" >Add</a-button >
15
15
<a-table bordered :dataSource =" dataSource" :columns =" columns" >
16
16
<template slot =" name" slot-scope =" text, record" >
17
- <editable-cell :text =" text" @change =" onCellChange(record.key, 'name')" />
17
+ <editable-cell :text =" text" @change =" onCellChange(record.key, 'name', $event )" />
18
18
</template >
19
19
<template slot =" operation" slot-scope =" text, record" >
20
20
<a-popconfirm
@@ -69,15 +69,13 @@ export default {
69
69
}
70
70
},
71
71
methods: {
72
- onCellChange (key , dataIndex ) {
73
- return (value ) => {
72
+ onCellChange (key , dataIndex , value ) {
74
73
const dataSource = [... this .dataSource ]
75
74
const target = dataSource .find (item => item .key === key)
76
75
if (target) {
77
76
target[dataIndex] = value
78
77
this .dataSource = dataSource
79
78
}
80
- }
81
79
},
82
80
onDelete (key ) {
83
81
const dataSource = [... this .dataSource ]
You can’t perform that action at this time.
0 commit comments