Skip to content

Commit 9f9ab21

Browse files
HelloMolitangjinzhou
authored andcommitted
Update edit-cell.md (#605)
1 parent 82081f1 commit 9f9ab21

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

components/table/demo/edit-cell.md

+2-4
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Table with editable cells.
1414
<a-button class="editable-add-btn" @click="handleAdd">Add</a-button>
1515
<a-table bordered :dataSource="dataSource" :columns="columns">
1616
<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)"/>
1818
</template>
1919
<template slot="operation" slot-scope="text, record">
2020
<a-popconfirm
@@ -69,15 +69,13 @@ export default {
6969
}
7070
},
7171
methods: {
72-
onCellChange (key, dataIndex) {
73-
return (value) => {
72+
onCellChange (key, dataIndex, value) {
7473
const dataSource = [...this.dataSource]
7574
const target = dataSource.find(item => item.key === key)
7675
if (target) {
7776
target[dataIndex] = value
7877
this.dataSource = dataSource
7978
}
80-
}
8179
},
8280
onDelete (key) {
8381
const dataSource = [...this.dataSource]

0 commit comments

Comments
 (0)