Przeglądaj źródła

Table: Hack for dynamics change columns.

Liril 8 lat temu
rodzic
commit
d233a16821

+ 2 - 0
packages/table/src/table-store.js

@@ -198,6 +198,7 @@ TableStore.prototype.mutations = {
       states.reserveSelection = column.reserveSelection;
     }
 
+    this.updateColumns();  // hack for dynamics insert column
     this.scheduleLayout();
   },
 
@@ -207,6 +208,7 @@ TableStore.prototype.mutations = {
       _columns.splice(_columns.indexOf(column), 1);
     }
 
+    this.updateColumns();  // hack for dynamics remove column
     this.scheduleLayout();
   },
 

+ 1 - 1
packages/table/src/table.vue

@@ -246,7 +246,7 @@
 
     created() {
       this.tableId = 'el-table_' + tableIdSeed + '_';
-      this.debouncedLayout = debounce(50, true, () => this.doLayout());
+      this.debouncedLayout = debounce(50, () => this.doLayout());
     },
 
     computed: {