Tree: checkbox can be disabled

This commit is contained in:
Dreamacro
2017-07-19 18:36:26 +08:00
committed by 杨奕
parent 6f724ea6a3
commit 476f76875c
7 changed files with 327 additions and 75 deletions

View File

@@ -18,8 +18,8 @@
v-if="showCheckbox"
v-model="node.checked"
:indeterminate="node.indeterminate"
@change="handleCheckChange"
@click.native.stop="handleUserClick">
:disabled="!!node.disabled"
@change="handleCheckChange">
</el-checkbox>
<span
v-if="node.loading"
@@ -155,16 +155,8 @@
}
},
handleUserClick() {
if (this.node.indeterminate) {
this.node.setChecked(this.node.checked, !this.tree.checkStrictly);
}
},
handleCheckChange(ev) {
if (!this.node.indeterminate) {
this.node.setChecked(ev.target.checked, !this.tree.checkStrictly);
}
this.node.setChecked(ev.target.checked, !this.tree.checkStrictly);
},
handleChildNodeExpand(nodeData, node, instance) {