Merge pull request #120 from QingWei-Li/next

Table: Fix static render fail
pull/2/head
杨奕 2016-08-30 22:02:56 -05:00 committed by GitHub
commit cc7bfc0124
5 changed files with 32 additions and 17 deletions

View File

@ -58,6 +58,19 @@
``` ```
::: :::
<script>
export default {
methods: {
handleSizeChange(val) {
console.log(`每页 ${val} 条`);
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`);
}
}
}
</script>
### Attributes ### Attributes
| 参数 | 说明 | 类型 | 可选值 | 默认值 | | 参数 | 说明 | 类型 | 可选值 | 默认值 |
|--------------------|----------------------------------------------------------|-------------------|-------------|--------| |--------------------|----------------------------------------------------------|-------------------|-------------|--------|

View File

@ -134,14 +134,14 @@ Tooltip 组件提供了两个不同的主题:`dark`和`light`。
如果需要关闭`tooltip`功能,`disabled`属性可以满足这个需求,它接受一个`Boolean`,设置为`true`即可。 如果需要关闭`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文档会做一一说明。 当然Tooltip 组件实际上十分强大文末的API文档会做一一说明。
:::demo :::demo
```html ```html
<template> <template>
<el-tooltip :disabled="disabled" content="点击关闭 tooltip 功能" transition="slide-fade" placement="bottom" effect="light"> <el-tooltip :disabled="disabled" content="点击关闭 tooltip 功能" placement="bottom" effect="light">
<el-button @click.native="disabled=true">点击关闭 tooltip 功能</el-button> <el-button @click.native="disabled=true">点击关闭 tooltip 功能</el-button>
</el-tooltip> </el-tooltip>
</template> </template>

View File

@ -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 {
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 {
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 customRender = _self.$options.render;
renderColumn = function(_h) { renderColumn = function() {
return costomRender.call(data, _h); return customRender.call(objectAssign(_self, data));
}; };
}; };
@ -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;

View File

@ -64,9 +64,6 @@ export default {
functional: true, functional: true,
render(h, { children }) { render(h, { children }) {
const data = { const data = {
props: {
appear: true
},
on: new Transition() on: new Transition()
}; };

View File

@ -6,13 +6,12 @@
<span class="el-tree-node__expand-icon" <span class="el-tree-node__expand-icon"
:class="{ 'is-leaf': node.isLeaf, expanded: !node.isLeaf && expanded }" :class="{ 'is-leaf': node.isLeaf, expanded: !node.isLeaf && expanded }"
></span> ></span>
<el-checkbox v-if="showCheckbox" :indeterminate="node.indeterminate" v-model="node.checked" :true-label="true" :false-label="false" @change="handleCheckChange"></el-checkbox> <el-checkbox v-if="showCheckbox" :indeterminate="node.indeterminate" v-model="node.checked" @change="handleCheckChange"></el-checkbox>
<!--<span class="el-tree-node__icon {{ node.icon }} {{ node.loading ? 'el-icon-loading' : '' }}" v-if="node.icon"></span>--> <!--<span class="el-tree-node__icon {{ node.icon }} {{ node.loading ? 'el-icon-loading' : '' }}" v-if="node.icon"></span>-->
<span class="el-tree-node__label">{{ node.label }}</span> <span class="el-tree-node__label">{{ node.label }}</span>
</div> </div>
<collapse-transition> <collapse-transition>
<div class="el-tree-node__children" <div class="el-tree-node__children"
v-if="childrenRendered"
v-show="expanded"> v-show="expanded">
<el-tree-node v-for="child in node.children" :node="child"></el-tree-node> <el-tree-node v-for="child in node.children" :node="child"></el-tree-node>
</div> </div>