vue-router

  $router.forward

  $router.back

  $router.go

缓存路由组件

  作用:使不展示的路由组件仍然保持挂载,不在切换路由的时候被销魂

  

<keep-alive include='组件名'>
    <router-view></router-view>
</keep-alive>

//缓存多个
<keep-alive :include="['组件名1','组件名2']">
    <router-view></router-view>
</keep-alive>

 

 

  

posted @ 2022-05-17 19:12  清水紅葉  阅读(15)  评论(0编辑  收藏  举报