mirror of https://github.com/ElemeFE/element
Table: 在type="index"如果设置了label 优先显示label
parent
03a60995d6
commit
386a8466b0
|
@ -35,7 +35,7 @@ const forced = {
|
||||||
},
|
},
|
||||||
index: {
|
index: {
|
||||||
// headerTemplate: function(h) { return <div>#</div>; },
|
// headerTemplate: function(h) { return <div>#</div>; },
|
||||||
headerTemplate: function(h) { return <div>{ this.$options.propsData.columns[0].label ? this.$options.propsData.columns[0].label : '#' }</div>; },
|
headerTemplate: function(h, label) { return <div>{ label || '#' }</div>; },
|
||||||
template: function(h, { row, $index }) { return <div>{ $index + 1 }</div>; },
|
template: function(h, { row, $index }) { return <div>{ $index + 1 }</div>; },
|
||||||
sortable: false
|
sortable: false
|
||||||
},
|
},
|
||||||
|
|
|
@ -30,7 +30,7 @@ export default {
|
||||||
{
|
{
|
||||||
[
|
[
|
||||||
column.headerTemplate
|
column.headerTemplate
|
||||||
? column.headerTemplate.call(this._renderProxy, h)
|
? column.headerTemplate.call(this._renderProxy, h, column.label)
|
||||||
: <div>{ column.label }</div>,
|
: <div>{ column.label }</div>,
|
||||||
column.sortable
|
column.sortable
|
||||||
? <div class="caret-wrapper">
|
? <div class="caret-wrapper">
|
||||||
|
|
Loading…
Reference in New Issue