Commit 0e478016 authored by hejinming's avatar hejinming Committed by 杨奕

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

parent 0c824d61
...@@ -185,17 +185,24 @@ export default { ...@@ -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 { ...@@ -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) {
......
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