diff --git a/demo/documentation/components/advanceTableDemos/basicUsage.demo.vue b/demo/documentation/components/advanceTableDemos/basicUsage.demo.vue index c0d3055e0..4ecfcadd5 100644 --- a/demo/documentation/components/advanceTableDemos/basicUsage.demo.vue +++ b/demo/documentation/components/advanceTableDemos/basicUsage.demo.vue @@ -6,6 +6,8 @@ 多选删除(注意:data数据发生变化后,多选的状态将会被清空)
行添加className +
+ 自定义渲染头
{ title: 'Name', key: 'name', sortable: true, - width: 300 + width: 300, + renderHeader(h,column){ + return {column.title} + } }, { title: 'Age', diff --git a/packages/common/AdvanceTable/row/index.js b/packages/common/AdvanceTable/row/index.js index 5de7c083f..53edfea4f 100644 --- a/packages/common/AdvanceTable/row/index.js +++ b/packages/common/AdvanceTable/row/index.js @@ -10,9 +10,9 @@ export default { render: (h, ctx) => { const params = ctx.props.row - const { keyName, render, row } = ctx.props + const { keyName, render } = ctx.props if (render) { - return h('div', [render(h, params)]) + return render(h, params) } else return h('div', [params.row[keyName]]) } } diff --git a/packages/common/AdvanceTable/src/main.vue b/packages/common/AdvanceTable/src/main.vue index 901d2133a..43706fb49 100644 --- a/packages/common/AdvanceTable/src/main.vue +++ b/packages/common/AdvanceTable/src/main.vue @@ -71,7 +71,14 @@ :indeterminate="!isCheckedBoxAllIndeterminate" @click.native="onAllCheckboxesClick" /> - {{ column.title }} + + {{ !column.renderHeader ? column.title : '' }}