parent
3c145e6ffe
commit
53754a3185
3 changed files with 11 additions and 3 deletions
|
@ -54,6 +54,10 @@
|
|||
const nodes = findComponentsDownward(this, 'TreeNode');
|
||||
return nodes.filter(node => node.data.selected).map(node => node.data);
|
||||
},
|
||||
getCheckedNodes () {
|
||||
const nodes = findComponentsDownward(this, 'TreeNode');
|
||||
return nodes.filter(node => node.data.checked).map(node => node.data);
|
||||
},
|
||||
updateData (isInit = true) {
|
||||
// init checked status
|
||||
function reverseChecked(data) {
|
||||
|
@ -105,6 +109,9 @@
|
|||
this.$on('checked', () => {
|
||||
this.updateData(false);
|
||||
});
|
||||
this.$on('on-checked', () => {
|
||||
this.$emit('on-check-change', this.getCheckedNodes());
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
Loading…
Add table
Add a link
Reference in a new issue