Commit d538f180 authored by qingwei.li's avatar qingwei.li

Table: Fix static render fail

parent 1cb5b162
...@@ -94,11 +94,16 @@ export default { ...@@ -94,11 +94,16 @@ export default {
data() { data() {
return { return {
isChildColumn: false, isChildColumn: false,
columns: [], columns: []
row: {}
}; };
}, },
beforeCreate() {
this.row = {};
this.column = {};
this.$index = 0;
},
components: { components: {
ElCheckbox, ElCheckbox,
ElTag ElTag
...@@ -137,8 +142,8 @@ export default { ...@@ -137,8 +142,8 @@ export default {
let property = this.property; let property = this.property;
if (property) { if (property) {
template = function(h, { row }) { template = function(h, { row }, parent) {
return <span>{ this.$getPropertyText(row, property, columnId) }</span>; return <span>{ parent.$getPropertyText(row, property, columnId) }</span>;
}; };
} }
...@@ -161,12 +166,13 @@ export default { ...@@ -161,12 +166,13 @@ export default {
let renderColumn = column.template; let renderColumn = column.template;
let _self = this; let _self = this;
column.template = function(h, data) { column.template = function(h, data) {
if (_self.$vnode.data.inlineTemplate) { if (_self.$vnode.data.inlineTemplate) {
let costomRender = _self.$options.render; let costomRender = _self.$options.render;
renderColumn = function(_h) { renderColumn = function() {
return costomRender.call(data, _h); return costomRender.call(objectAssign(_self, data));
}; };
}; };
...@@ -176,10 +182,10 @@ export default { ...@@ -176,10 +182,10 @@ export default {
effect={ this.effect } effect={ this.effect }
placement="top" placement="top"
disabled={ this.tooltipDisabled }> disabled={ this.tooltipDisabled }>
<div class="cell">{ renderColumn.call(this._renderProxy, h, data) }</div> <div class="cell">{ renderColumn(h, data, this._renderProxy) }</div>
<span slot="content">{ renderColumn.call(this._renderProxy, h, data) }</span> <span slot="content">{ renderColumn(h, data, this._renderProxy) }</span>
</el-tooltip> </el-tooltip>
: <div class="cell">{ renderColumn.call(this._renderProxy, h, data) }</div>; : <div class="cell">{ renderColumn(h, data, this._renderProxy) }</div>;
}; };
this.columnConfig = column; this.columnConfig = column;
......
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