Commit b4484401 authored by 杨奕's avatar 杨奕 Committed by GitHub

Merge pull request #107 from spademan/master

Table: el-table-column的type="index"并且如果设置了label 优先显示label
parents 407c0a52 386a8466
...@@ -34,7 +34,8 @@ const forced = { ...@@ -34,7 +34,8 @@ const forced = {
resizable: false resizable: false
}, },
index: { 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>; }, template: function(h, { row, $index }) { return <div>{ $index + 1 }</div>; },
sortable: false sortable: false
}, },
......
...@@ -30,7 +30,7 @@ export default { ...@@ -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">
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment