add listener on Tree: on-toggle-expand
This commit is contained in:
parent
01b8d340c5
commit
75dad87376
2 changed files with 4 additions and 1 deletions
|
@ -98,6 +98,7 @@
|
|||
handleExpand () {
|
||||
if (this.data.disabled) return;
|
||||
this.$set(this.data, 'expand', !this.data.expand);
|
||||
this.dispatch('Tree', 'toggle-expand', this.data);
|
||||
},
|
||||
handleSelect () {
|
||||
if (this.data.disabled) return;
|
||||
|
|
|
@ -102,7 +102,6 @@
|
|||
},
|
||||
mounted () {
|
||||
this.updateData();
|
||||
|
||||
this.$on('selected', ori => {
|
||||
const nodes = findComponentsDownward(this, 'TreeNode');
|
||||
nodes.forEach(node => {
|
||||
|
@ -119,6 +118,9 @@
|
|||
this.$on('on-checked', () => {
|
||||
this.$emit('on-check-change', this.getCheckedNodes());
|
||||
});
|
||||
this.$on('toggle-expand', (payload) => {
|
||||
this.$emit('on-toggle-expand', payload);
|
||||
});
|
||||
},
|
||||
watch: {
|
||||
data () {
|
||||
|
|
Loading…
Add table
Reference in a new issue