소스 검색

Table: 在type="index"如果设置了label 优先显示label

spademan 9 년 전
부모
커밋
03a60995d6
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      packages/table/src/table-column.js

+ 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) { return <div>{ this.$options.propsData.columns[0].label ? this.$options.propsData.columns[0].label : '#' }</div>; },
     template: function(h, { row, $index }) { return <div>{ $index + 1 }</div>; },
     sortable: false
   },