mirror of https://github.com/ElemeFE/element
				
				
				
			Table: fix multi-header remove column (#9377)
							parent
							
								
									a75667ab78
								
							
						
					
					
						commit
						d641360605
					
				| 
						 | 
				
			
			@ -297,7 +297,8 @@ export default {
 | 
			
		|||
 | 
			
		||||
  destroyed() {
 | 
			
		||||
    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: {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -256,10 +256,14 @@ TableStore.prototype.mutations = {
 | 
			
		|||
    this.scheduleLayout();
 | 
			
		||||
  },
 | 
			
		||||
 | 
			
		||||
  removeColumn(states, column) {
 | 
			
		||||
    let _columns = states._columns;
 | 
			
		||||
    if (_columns) {
 | 
			
		||||
      _columns.splice(_columns.indexOf(column), 1);
 | 
			
		||||
  removeColumn(states, column, parent) {
 | 
			
		||||
    let array = states._columns;
 | 
			
		||||
    if (parent) {
 | 
			
		||||
      array = parent.children;
 | 
			
		||||
      if (!array) array = parent.children = [];
 | 
			
		||||
    }
 | 
			
		||||
    if (array) {
 | 
			
		||||
      array.splice(array.indexOf(column), 1);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    this.updateColumns(); // hack for dynamics remove column
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue