0👍
✅
The problem is your config
watcher only watch the change of config
not its nested properties so this.config.series = [...]
won’t trigger your watcher.
First solution, use deep
option:
watch: {
config: {
handler() {
this.render()
},
deep: true
}
}
Second solution, use spread syntax to assign the whole object:
this.config = {
...this.config,
series: [{ /* */ }]
}
0👍
Here is the solution for you:
-
Destruct the config object in render method to lose a reference:
render() { this.chart = Highcharts.chart('container', {...this.config}); }
-
Change your config watcher to deep (that way watcher will react when you are changing property that belongs to the object e.g.
this.config.series = [...]
):config: { deep: true, handler() { this.render(); } }
Source:stackexchange.com