From d8892603f7b4e52259c9eece3252969b17889398 Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Fri, 17 Mar 2017 09:50:11 +0800 Subject: [PATCH] Table prop: content modify to context --- src/components/table/cell.vue | 4 ++-- src/components/table/table.vue | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/components/table/cell.vue b/src/components/table/cell.vue index b990238..7a8c188 100644 --- a/src/components/table/cell.vue +++ b/src/components/table/cell.vue @@ -31,7 +31,7 @@ return { renderType: '', uid: -1, - content: this.$parent.$parent.currentContent + context: this.$parent.$parent.currentContext }; }, computed: { @@ -48,7 +48,7 @@ methods: { compile () { if (this.column.render) { - const $parent = this.content; + const $parent = this.context; const template = this.column.render(this.row, this.column, this.index); const cell = document.createElement('div'); cell.innerHTML = template; diff --git a/src/components/table/table.vue b/src/components/table/table.vue index 0d1ba17..4ff579a 100644 --- a/src/components/table/table.vue +++ b/src/components/table/table.vue @@ -142,7 +142,7 @@ return ''; } }, - content: { + context: { type: Object }, noDataText: { @@ -173,7 +173,7 @@ bodyHeight: 0, bodyRealHeight: 0, scrollBarWidth: getScrollBarSize(), - currentContent: this.content, + currentContext: this.context, cloneData: deepCopy(this.data) // when Cell has a button to delete row data, clickCurrentRow will throw an error, so clone a data }; }, @@ -644,7 +644,7 @@ } }, created () { - if (!this.content) this.currentContent = this.$parent; + if (!this.context) this.currentContext = this.$parent; this.showSlotHeader = this.$refs.title !== undefined; this.showSlotFooter = this.$refs.footer !== undefined; this.rebuildData = this.makeDataWithSortAndFilter(); -- libgit2 0.21.4