Merge pull request #107 from spademan/master

Table: el-table-column的type="index"并且如果设置了label 优先显示label
pull/110/head
杨奕 2016-09-21 00:50:44 -05:00 committed by GitHub
commit b44844014e
2 changed files with 3 additions and 2 deletions

View File

@ -34,7 +34,8 @@ const forced = {
resizable: false
},
index: {
headerTemplate: function(h) { return <div>#</div>; },
// headerTemplate: function(h) { return <div>#</div>; },
headerTemplate: function(h, label) { return <div>{ label || '#' }</div>; },
template: function(h, { row, $index }) { return <div>{ $index + 1 }</div>; },
sortable: false
},

View File

@ -30,7 +30,7 @@ export default {
{
[
column.headerTemplate
? column.headerTemplate.call(this._renderProxy, h)
? column.headerTemplate.call(this._renderProxy, h, column.label)
: <div>{ column.label }</div>,
column.sortable
? <div class="caret-wrapper">