Send commit, in the mounted of vue, but the changed data is not received after the page is refreshed

uses vuex to manage the state. In the mounted of vue, commit sends asynchronous requests, and computed receives the modified data, but the data is printed in mounted but it is still in the initial state, and the latest value cannot be obtained by using nextTick. There is no problem with page rendering. It is the latest data. I would like to ask, how to get the latest data, because we have to use the changed data to do some judgment processing. Thank you!

May.28,2021

first of all, it is not clear why commit? is used to obtain asynchronous data.
and then put the code on, isn't it?


use watch .

Menu