0👍
You can use async/await
like so:
async created(){
await this.validateToken();
}
This will prevent the create lifecycle hook from completing until the validateToken returns a response
- [Vuejs]-Bootstrap's Normalize overriding Boostrap.min.css
- [Vuejs]-`this` direction in vue / typescript / vue-awesome-swiper
0👍
I am assuming you have a router-view
in your App.vue file.
You can keep a flag / variable for your async data and then load the router-view
only if that data is available.
<template>
<router-view v-if="data"></router-view>
</template>
This way, your inner children aren’t even loaded till the time your async data is available.
This answer is just the same comment I made on the question above but for future people to come.
- [Vuejs]-Responsive gallery Vue.js
- [Vuejs]-Vue.js precise CSS class toggling for CSS animation retriggering
Source:stackexchange.com