0👍
The issue here is that the mounted hook is executing before the async vuex function resolves.
Check out this answer – VueJS – Accessing store data inside mounted
It explains how you could use watch
to trigger a function when the async function resolves.
- [Vuejs]-Window.setTimeout() problems
- [Vuejs]-Error in render: "TypeError: Cannot read property 'PAY_TYPE' of null"
Source:stackexchange.com