1👍
✅
I think you should use vue lifecycle named ‘mounted’. Create a data named for example ‘isMounted’ and set it to true.
data() {
return {
isMounted: true
}
}
then use it in your html as:
<div v-if="isMounted"></div>
Then change its value in the mounted lifecycle as follows:
mounted(){
this.isMounted = this.foo();
}
Source:stackexchange.com