From 522717a964aaf02a2cdd1ec48688dd9ea2b87c60 Mon Sep 17 00:00:00 2001 From: cagataycivici Date: Sun, 28 Jul 2019 14:32:46 +0300 Subject: [PATCH] Two way binding for collapsed keys --- src/components/organizationchart/OrganizationChart.vue | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/components/organizationchart/OrganizationChart.vue b/src/components/organizationchart/OrganizationChart.vue index 561961c15..932d59c4f 100644 --- a/src/components/organizationchart/OrganizationChart.vue +++ b/src/components/organizationchart/OrganizationChart.vue @@ -27,6 +27,11 @@ export default { d_collapsedKeys: this.collapsedKeys || {} } }, + watch() { + collapsedKeys(newValue) { + this.d_collapsedKeys = newValue; + } + }, methods: { onNodeToggle(key) { if (this.d_collapsedKeys[key]) @@ -35,6 +40,7 @@ export default { this.d_collapsedKeys[key] = true; this.d_collapsedKeys = {...this.d_collapsedKeys}; + this.$emit('update:collapsedKeys', this.d_collapsedKeys); } }, components: {