Vue - Preload dynamic components

789 Views Asked by At

In vue, one can render dynamic components by this:
<keep-alive> <component v-bind:is="currentTabComponent"></component> </keep-alive>
If components are A,B,C and currentTabComponent = A, component A will be rendered first and will be kept alive. Then upon clicking other components, B and C will render eventually and all components will be kept alive.
My question is how to render them such a way, where they all will be alive just after rendering instead of only the first one. I've tried mount and before mount lifecycle hooks but they doesn't work.
To summarise, If I assume keep alive is an array under the hood, default behaviour is: keepalive[A] , then keepalive[A,B] at last keepalive [A,B,C]
I want it to be like this at the start: keepalive[A,B,C].

0

There are 0 best solutions below