Commit 0d8e31f4 authored by xiong hanbiao's avatar xiong hanbiao Committed by 杨奕

Table: fix multi-header remove column (#9377)

parent 5bb74360
...@@ -295,7 +295,8 @@ export default { ...@@ -295,7 +295,8 @@ export default {
destroyed() { destroyed() {
if (!this.$parent) return; if (!this.$parent) return;
this.owner.store.commit('removeColumn', this.columnConfig); const parent = this.$parent;
this.owner.store.commit('removeColumn', this.columnConfig, this.isSubColumn ? parent.columnConfig : null);
}, },
watch: { watch: {
......
...@@ -204,10 +204,14 @@ TableStore.prototype.mutations = { ...@@ -204,10 +204,14 @@ TableStore.prototype.mutations = {
this.scheduleLayout(); this.scheduleLayout();
}, },
removeColumn(states, column) { removeColumn(states, column, parent) {
let _columns = states._columns; let array = states._columns;
if (_columns) { if (parent) {
_columns.splice(_columns.indexOf(column), 1); array = parent.children;
if (!array) array = parent.children = [];
}
if (array) {
array.splice(array.indexOf(column), 1);
} }
this.updateColumns(); // hack for dynamics remove column this.updateColumns(); // hack for dynamics remove column
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment