mirror of https://github.com/ElemeFE/element
Table: add disabled state to multiple selection header checkbox (#9543)
parent
ca02cb9cd3
commit
ba284c72d7
|
@ -34,6 +34,7 @@ const forced = {
|
|||
selection: {
|
||||
renderHeader: function(h, { store }) {
|
||||
return <el-checkbox
|
||||
disabled={ store.states.data && store.states.data.length === 0 }
|
||||
indeterminate={ store.states.selection.length > 0 && !this.isAllSelected }
|
||||
nativeOn-click={ this.toggleAllSelection }
|
||||
value={ this.isAllSelected } />;
|
||||
|
|
|
@ -298,6 +298,7 @@ TableStore.prototype.mutations = {
|
|||
|
||||
toggleAllSelection: debounce(10, function(states) {
|
||||
const data = states.data || [];
|
||||
if (data.length === 0) return;
|
||||
const value = !states.isAllSelected;
|
||||
const selection = this.states.selection;
|
||||
let selectionChanged = false;
|
||||
|
|
Loading…
Reference in New Issue