Эх сурвалжийг харах

Merge pull request #107 from spademan/master

Table: el-table-column的type="index"并且如果设置了label 优先显示label
杨奕 9 жил өмнө
parent
commit
b44844014e

+ 2 - 1
packages/table/src/table-column.js

@@ -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
   },

+ 1 - 1
packages/table/src/table-header.js

@@ -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">