Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
ziyoung committed Jun 24, 2019
1 parent c275d3f commit 1e79646
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/table/src/store/watcher.js
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,16 @@ export default Vue.extend({
deleted = selection.filter(item => data.indexOf(item) === -1);
}
if (deleted.length) {
states.selection = selection.filter(item => deleted.indexOf(item) === -1);
this.table.$emit('selection-change', selection.slice());
const newSelection = selection.filter(item => deleted.indexOf(item) === -1);
states.selection = newSelection;
this.table.$emit('selection-change', newSelection.slice());
}
},

toggleRowSelection(row, selected, emitChange = true) {
const changed = toggleRowStatus(this.states.selection, row, selected);
if (changed) {
const newSelection = this.states.selection ? this.states.selection.slice() : [];
const newSelection = (this.states.selection || []).slice();
// 调用 API 修改选中值,不触发 select 事件
if (emitChange) {
this.table.$emit('select', newSelection, row);
Expand Down

0 comments on commit 1e79646

Please sign in to comment.