rebuild Tree component
This commit is contained in:
梁灏 2017-03-24 23:14:10 +08:00
parent 3c145e6ffe
commit 53754a3185
3 changed files with 11 additions and 3 deletions

View file

@ -58,8 +58,7 @@
data () {
return {
prefixCls: prefixCls,
indeterminate: false,
checked: false
indeterminate: false
};
},
computed: {
@ -120,6 +119,7 @@
}
this.data.checked = checked;
this.dispatch('Tree', 'checked');
this.dispatch('Tree', 'on-checked');
},
setIndeterminate () {
this.indeterminate = this.data.checked ? false : findComponentsDownward(this, 'TreeNode').some(node => node.data.checked);
@ -131,6 +131,7 @@
},
mounted () {
this.$on('indeterminate', () => {
this.broadcast('TreeNode', 'indeterminate');
this.setIndeterminate();
});
}