eCharts common things into bundle but options on the element #4154
-
Dear Folks, I have the following code in my project for display eChart diagrams.
I tried something like this in the bundle is:
But in this way when I update public $dataset in livewire, the $watch is not getting the newest options, because get options() does not runs again. How could I fix this? Thank you so much! |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
getters only run when they are gotten. What is getting them? Here you don't have anything getting them. you're just passing in a fixed set of options. |
Beta Was this translation helpful? Give feedback.
-
I figured out a solution with nested x-data in a Laravel component.
and this is how x-chart component looks like:
and in the app.js bundle i define data('echart'):
With this I can make a lot of charts with different options but common things like init, update and destroy are in one place. |
Beta Was this translation helpful? Give feedback.
getters only run when they are gotten.
What is getting them?
Here you don't have anything getting them. you're just passing in a fixed set of options.