Skip to content

Commit 68ddd4f

Browse files
authored
Merge pull request #115 from linziguan/master
fix: solve rowSelection affected by alert prop.
2 parents 9a83387 + 556cc7b commit 68ddd4f

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

src/components/table/index.js

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ export default {
5151
},
5252
rowSelection: {
5353
type: Object,
54-
default: () => ({})
54+
default: null
5555
},
5656
/** @Deprecated */
5757
showAlertInfo: {
@@ -254,7 +254,7 @@ export default {
254254
}
255255
if (k === 'rowSelection') {
256256
if (showAlert && this.rowSelection) {
257-
// 重新绑定 rowSelection 事件
257+
// 如果需要使用alert,则重新绑定 rowSelection 事件
258258
props[k] = {
259259
selectedRows: this.selectedRows,
260260
selectedRowKeys: this.selectedRowKeys,
@@ -264,10 +264,11 @@ export default {
264264
}
265265
}
266266
return props[k]
267+
} else if (!this.rowSelection) {
268+
// 如果没打算开启 rowSelection 则清空默认的选择项
269+
props[k] = null
270+
return props[k]
267271
}
268-
// 如果没打算开启 rowSelection 则清空默认的选择项
269-
props[k] = null
270-
return props[k]
271272
}
272273
props[k] = this[k]
273274
return props[k]

0 commit comments

Comments
 (0)