Vue toggles the currently displayed components, and the toggle button itself needs to wait for the new component to be rendered before the state is changed.

The basic structure of

is as follows. The button above is used to switch the displayed k-line or its configuration. The k-line below uses echarts, to request data and it will take a certain amount of time to complete the rendering. From the time-sharing button, switch to the 5th button, the background color of the button will change.
the problem is that the change in the background color of the button does not occur until the following curve is drawn.
can you have a solution so that the state of the button changes first, and then the rendering of the following curve is completed asynchronously?
clipboard.png

Feb.28,2021
Menu