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,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();
|
||||
|
|
Loading…
Reference in New Issue