Two way binding for collapsed keys

pull/41/head
cagataycivici 2019-07-28 14:32:46 +03:00
parent 1c10bdf86d
commit 522717a964
1 changed files with 6 additions and 0 deletions

View File

@ -27,6 +27,11 @@ export default {
d_collapsedKeys: this.collapsedKeys || {} d_collapsedKeys: this.collapsedKeys || {}
} }
}, },
watch() {
collapsedKeys(newValue) {
this.d_collapsedKeys = newValue;
}
},
methods: { methods: {
onNodeToggle(key) { onNodeToggle(key) {
if (this.d_collapsedKeys[key]) if (this.d_collapsedKeys[key])
@ -35,6 +40,7 @@ export default {
this.d_collapsedKeys[key] = true; this.d_collapsedKeys[key] = true;
this.d_collapsedKeys = {...this.d_collapsedKeys}; this.d_collapsedKeys = {...this.d_collapsedKeys};
this.$emit('update:collapsedKeys', this.d_collapsedKeys);
} }
}, },
components: { components: {