Tree add check-directly prop

This commit is contained in:
梁灏 2019-02-27 10:22:01 +08:00
parent 98221c87b6
commit 467e2cf9a4
3 changed files with 21 additions and 211 deletions

View file

@ -41,6 +41,7 @@
export default {
name: 'TreeNode',
mixins: [ Emitter ],
inject: ['TreeInstance'],
components: { Checkbox, Icon, CollapseTransition, Render },
props: {
data: {
@ -156,7 +157,11 @@
},
handleSelect () {
if (this.data.disabled) return;
this.dispatch('Tree', 'on-selected', this.data.nodeKey);
if (this.TreeInstance.showCheckbox && this.TreeInstance.checkDirectly) {
this.handleCheck();
} else {
this.dispatch('Tree', 'on-selected', this.data.nodeKey);
}
},
handleCheck () {
if (this.data.disabled) return;