소스 검색

Table: add indeterminate state to multiple selection header checkbox (#9363)

* Table: Add indeterminate and disabled state to multiple selection header checkbox

* Remove disabled state handling of select-all checkbox
syn-zeta 7 년 전
부모
커밋
ca02cb9cd3
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      packages/table/src/table-column.js

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

@@ -32,8 +32,9 @@ const defaults = {
 
 const forced = {
   selection: {
-    renderHeader: function(h) {
+    renderHeader: function(h, { store }) {
       return <el-checkbox
+        indeterminate={ store.states.selection.length > 0 && !this.isAllSelected }
         nativeOn-click={ this.toggleAllSelection }
         value={ this.isAllSelected } />;
     },