0👍
Vue provides a transition
wrapper component, allowing you to add entering/leaving transitions for any element or component:
- Conditional rendering (using
v-if
). - Conditional display (using
v-show
).
That’s mean v-show
loading the assets but not showing other than v-if
. Also, the transition
will apply on both when you conditions activated. Here a live example.
0👍
I found a solution in case anyone else has the same problem.
Vue provides a keep-alive
tag, which caches the element and does not destroy it. And so my assets do not get re-downloaded each time even if I use v-if
.
Some more details on this question vue 2 lifecycle – how to stop beforeDestroy?
Source:stackexchange.com