0
votes

Is there any way to restrict keep-alive to only one specific route?

https://router.vuejs.org/api/#router-view

This keeps all the routes in memory:

<keep-alive>
    <router-view></router-view>
  </keep-alive>

I’d like only one of my particular routes to be kept in memory, not all of them. Can I define keep-alive another way? Possibly define it within the routed component itself?

1

1 Answers

0
votes

Try v-if on the keep-alive element.