diff --git a/src/components/table/cell.vue b/src/components/table/cell.vue index fa66892..ab92b72 100644 --- a/src/components/table/cell.vue +++ b/src/components/table/cell.vue @@ -27,7 +27,8 @@ data () { return { renderType: '', - uid: -1 + uid: -1, + content: this.$parent.$parent.content } }, computed: { @@ -43,7 +44,7 @@ methods: { compile () { if (this.column.render) { - const $parent = this.$parent.$parent.$parent; + const $parent = this.content; const template = this.column.render(this.row, this.column, this.index); const cell = document.createElement('div'); cell.innerHTML = template; @@ -59,7 +60,7 @@ } }, destroy () { - const $parent = this.$parent.$parent.$parent; + const $parent = this.content; for (let i = 0; i < $parent.$children.length; i++) { if ($parent.$children[i]._uid === this.uid) { $parent.$children[i].$destroy(); diff --git a/src/components/table/table-head.vue b/src/components/table/table-head.vue index 8e9ce55..9b60344 100644 --- a/src/components/table/table-head.vue +++ b/src/components/table/table-head.vue @@ -34,7 +34,7 @@
-