From d538f180fdd4ebdfd7fd930000e80c1079337d36 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Tue, 30 Aug 2016 15:36:21 +0800 Subject: [PATCH 1/3] Table: Fix static render fail --- packages/table/src/table-column.js | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/table/src/table-column.js b/packages/table/src/table-column.js index f4a3da8ce..6902bec31 100644 --- a/packages/table/src/table-column.js +++ b/packages/table/src/table-column.js @@ -94,11 +94,16 @@ export default { data() { return { isChildColumn: false, - columns: [], - row: {} + columns: [] }; }, + beforeCreate() { + this.row = {}; + this.column = {}; + this.$index = 0; + }, + components: { ElCheckbox, ElTag @@ -137,8 +142,8 @@ export default { let property = this.property; if (property) { - template = function(h, { row }) { - return { this.$getPropertyText(row, property, columnId) }; + template = function(h, { row }, parent) { + return { parent.$getPropertyText(row, property, columnId) }; }; } @@ -161,12 +166,13 @@ export default { let renderColumn = column.template; let _self = this; + column.template = function(h, data) { if (_self.$vnode.data.inlineTemplate) { let costomRender = _self.$options.render; - renderColumn = function(_h) { - return costomRender.call(data, _h); + renderColumn = function() { + return costomRender.call(objectAssign(_self, data)); }; }; @@ -176,10 +182,10 @@ export default { effect={ this.effect } placement="top" disabled={ this.tooltipDisabled }> -
{ renderColumn.call(this._renderProxy, h, data) }
- { renderColumn.call(this._renderProxy, h, data) } +
{ renderColumn(h, data, this._renderProxy) }
+ { renderColumn(h, data, this._renderProxy) } - :
{ renderColumn.call(this._renderProxy, h, data) }
; + :
{ renderColumn(h, data, this._renderProxy) }
; }; this.columnConfig = column; From 9bb4343d3f4975c4d3aec84605d3287d74952042 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Tue, 30 Aug 2016 19:06:15 +0800 Subject: [PATCH 2/3] Tree: Fix render bug --- examples/docs/pagination.md | 13 +++++++++++++ examples/docs/tooltip.md | 4 ++-- packages/tree/src/transition.js | 3 --- packages/tree/src/tree-node.vue | 3 +-- 4 files changed, 16 insertions(+), 7 deletions(-) diff --git a/examples/docs/pagination.md b/examples/docs/pagination.md index 77db1f655..0a2d72def 100644 --- a/examples/docs/pagination.md +++ b/examples/docs/pagination.md @@ -58,6 +58,19 @@ ``` ::: + + ### Attributes | 参数 | 说明 | 类型 | 可选值 | 默认值 | |--------------------|----------------------------------------------------------|-------------------|-------------|--------| diff --git a/examples/docs/tooltip.md b/examples/docs/tooltip.md index f0732566a..8297b0a43 100644 --- a/examples/docs/tooltip.md +++ b/examples/docs/tooltip.md @@ -134,14 +134,14 @@ Tooltip 组件提供了两个不同的主题:`dark`和`light`。 如果需要关闭`tooltip`功能,`disabled`属性可以满足这个需求,它接受一个`Boolean`,设置为`true`即可。 -事实上,这是基于[Vue-popper](https://github.com/element-component/vue-popper)的扩展,你可以自定义任意 Vue-popper 中允许定义的字段。 +事实上,这是基于 [Vue-popper](https://github.com/element-component/vue-popper) 的扩展,你可以自定义任意 Vue-popper 中允许定义的字段。 当然,Tooltip 组件实际上十分强大,文末的API文档会做一一说明。 :::demo ```html diff --git a/packages/tree/src/transition.js b/packages/tree/src/transition.js index 88efb9490..6d413e138 100644 --- a/packages/tree/src/transition.js +++ b/packages/tree/src/transition.js @@ -64,9 +64,6 @@ export default { functional: true, render(h, { children }) { const data = { - props: { - appear: true - }, on: new Transition() }; diff --git a/packages/tree/src/tree-node.vue b/packages/tree/src/tree-node.vue index 7e11f8cab..73963d44d 100644 --- a/packages/tree/src/tree-node.vue +++ b/packages/tree/src/tree-node.vue @@ -6,13 +6,12 @@ - + {{ node.label }}
From 6d247eef20913fb639682142b4d6d4dda47b9a43 Mon Sep 17 00:00:00 2001 From: "qingwei.li" Date: Wed, 31 Aug 2016 11:01:03 +0800 Subject: [PATCH 3/3] Table: fix typo --- packages/table/src/table-column.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/table/src/table-column.js b/packages/table/src/table-column.js index 6902bec31..90337a36c 100644 --- a/packages/table/src/table-column.js +++ b/packages/table/src/table-column.js @@ -169,10 +169,10 @@ export default { column.template = function(h, data) { if (_self.$vnode.data.inlineTemplate) { - let costomRender = _self.$options.render; + let customRender = _self.$options.render; renderColumn = function() { - return costomRender.call(objectAssign(_self, data)); + return customRender.call(objectAssign(_self, data)); }; };