打开src/api/router/index.js
路由配置项,找到对应的路由配置,添加noCache: true
参数,示例如下:
{
path: '/storage',
component: Layout,
hidden: true,
redirect: 'noredirect',
children: [
{
path: '/order',
component: () => import('@/views/storage/order'),
name: 'aterial',
meta: { title: '入库计划单', icon: 'user'}
},
{
path: '/inventory',
component: () => import('@/views/storage/inventory'),
name: 'inventory',
meta: { title: '收货清点', noCache: true, icon: 'user'} // 添加 noCache: true
}
]
}
在上述示例中,noCache: true
表示每次跳转都刷新缓存,默认是false
。这样设置后,在进行路由跳转时就不会使用缓存,而是每次都获取最新的数据。
另外,若依框架中还可能存在一些页面跳转缓存问题,以下是一些常见的解决方法:
-
问题:带参数打开