Table: fix table-column order disorder when made the assembly again

pull/8776/head
hejinming 2017-11-27 14:59:21 +08:00 committed by 杨奕
parent 0c824d61c8
commit 0e478016be
1 changed files with 10 additions and 3 deletions

View File

@ -185,17 +185,24 @@ export default {
parent = parent.$parent; parent = parent.$parent;
} }
return parent; return parent;
},
columnOrTableParent() {
let parent = this.$parent;
while (parent && !parent.tableId && !parent.columnId) {
parent = parent.$parent;
}
return parent;
} }
}, },
created() { created() {
this.customRender = this.$options.render; this.customRender = this.$options.render;
this.$options.render = h => h('div', this.$slots.default); this.$options.render = h => h('div', this.$slots.default);
this.columnId = (this.$parent.tableId || (this.$parent.columnId + '_')) + 'column_' + columnIdSeed++;
let parent = this.$parent; let parent = this.columnOrTableParent;
let owner = this.owner; let owner = this.owner;
this.isSubColumn = owner !== parent; this.isSubColumn = owner !== parent;
this.columnId = (parent.tableId || (parent.columnId + '_')) + 'column_' + columnIdSeed++;
let type = this.type; let type = this.type;
@ -376,7 +383,7 @@ export default {
mounted() { mounted() {
const owner = this.owner; const owner = this.owner;
const parent = this.$parent; const parent = this.columnOrTableParent;
let columnIndex; let columnIndex;
if (!this.isSubColumn) { if (!this.isSubColumn) {