mirror of https://github.com/ElemeFE/element
Table: change argument selection to cloned array in selection-change event (#9551)
parent
88af318e39
commit
b27f340561
|
@ -289,7 +289,7 @@ TableStore.prototype.mutations = {
|
||||||
|
|
||||||
if (changed) {
|
if (changed) {
|
||||||
const table = this.table;
|
const table = this.table;
|
||||||
table.$emit('selection-change', selection);
|
table.$emit('selection-change', selection ? selection.slice() : []);
|
||||||
table.$emit('select', selection, row);
|
table.$emit('select', selection, row);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ TableStore.prototype.mutations = {
|
||||||
|
|
||||||
const table = this.table;
|
const table = this.table;
|
||||||
if (selectionChanged) {
|
if (selectionChanged) {
|
||||||
table.$emit('selection-change', selection);
|
table.$emit('selection-change', selection ? selection.slice() : []);
|
||||||
}
|
}
|
||||||
table.$emit('select-all', selection);
|
table.$emit('select-all', selection);
|
||||||
states.isAllSelected = value;
|
states.isAllSelected = value;
|
||||||
|
@ -372,7 +372,7 @@ TableStore.prototype.clearSelection = function() {
|
||||||
const oldSelection = states.selection;
|
const oldSelection = states.selection;
|
||||||
states.selection = [];
|
states.selection = [];
|
||||||
if (oldSelection.length > 0) {
|
if (oldSelection.length > 0) {
|
||||||
this.table.$emit('selection-change', states.selection);
|
this.table.$emit('selection-change', states.selection ? states.selection.slice() : []);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -395,7 +395,7 @@ TableStore.prototype.setExpandRowKeys = function(rowKeys) {
|
||||||
TableStore.prototype.toggleRowSelection = function(row, selected) {
|
TableStore.prototype.toggleRowSelection = function(row, selected) {
|
||||||
const changed = toggleRowSelection(this.states, row, selected);
|
const changed = toggleRowSelection(this.states, row, selected);
|
||||||
if (changed) {
|
if (changed) {
|
||||||
this.table.$emit('selection-change', this.states.selection);
|
this.table.$emit('selection-change', this.states.selection ? this.states.selection.slice() : []);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -440,7 +440,7 @@ TableStore.prototype.cleanSelection = function() {
|
||||||
});
|
});
|
||||||
|
|
||||||
if (deleted.length) {
|
if (deleted.length) {
|
||||||
this.table.$emit('selection-change', selection);
|
this.table.$emit('selection-change', selection ? selection.slice() : []);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue