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 watchpull/1578/head
parent
8c9c0864df
commit
32293383fa
|
@ -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();
|
||||
},
|
||||
|
|
Loading…
Reference in New Issue