0👍
I think you are saying that the data isn’t there when it is first rendered. If that is the case, mounted is only called after the $el has already been populated, so you should move the dispatch to a lifecyle event that is before the initial rendering. Your best option is beforeCreate
Check out the fully lifecycle here. https://v2.vuejs.org/v2/guide/instance.html
- [Vuejs]-How i can order like a index book in Javascript?
- [Vuejs]-Accessing command line arguments in runtime
Source:stackexchange.com