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
pull/1578/head
Colin Bester 2021-09-21 09:51:41 -05:00 committed by GitHub
parent 8c9c0864df
commit 32293383fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 2 deletions

View File

@ -32,9 +32,17 @@ export default {
}
},
watch: {
data() {
/*
* 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();
},