mirror of https://github.com/ElemeFE/element
Merge pull request #107 from spademan/master
Table: el-table-column的type="index"并且如果设置了label 优先显示labelpull/110/head
commit
b44844014e
|
@ -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
|
||||
},
|
||||
|
|
|
@ -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">
|
||||
|
|
Loading…
Reference in New Issue