From 32293383fa419a8ec4d9cea7018e336402861d46 Mon Sep 17 00:00:00 2001 From: Colin Bester Date: Tue, 21 Sep 2021 09:51:41 -0500 Subject: [PATCH] Update Chart.vue to trigger on any change to object data Use deep watch on data prop to enable triggering watch for changes within structure otherwise the entire data object needs to be replaced to trigger watch --- src/components/chart/Chart.vue | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/components/chart/Chart.vue b/src/components/chart/Chart.vue index cd44081a8..d99796c9c 100755 --- a/src/components/chart/Chart.vue +++ b/src/components/chart/Chart.vue @@ -32,8 +32,16 @@ export default { } }, watch: { - data() { - this.reinit(); + /* + * Use deep watch to enable triggering watch for changes within structure + * otherwise the entire data object needs to be replaced to trigger watch + */ + data: { + handler(val, oldVal) { + console.log('watch data') + this.reinit(); + }, + deep: true }, type() { this.reinit();