现在时无论跳转哪个页面都会缓存
{
path: '/statistics/customerAsset/index',
component: () => import('../view/statistics/customerAsset/index.vue'),
meta: {
title: '客户资产统计',
keepAlive: true
}
},
<el-main>
<keep-alive>
<router-view v-if="$route.meta.keepAlive" />
</keep-alive>
<router-view v-if="!$route.meta.keepAlive" />
</el-main>
可以使用<keep-alive>的include或者exclude属性。前提是你有给路由组件设置name属性。
https://v2.cn.vuejs.org/v2/ap...