Tree add check-directly prop
This commit is contained in:
parent
98221c87b6
commit
467e2cf9a4
3 changed files with 21 additions and 211 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue