1.缓存组件:

组件路由routers.js页面添加keepAlive:true

{
path: 'supplierList',
name: 'supplierList',
meta: {
title: '供应商列表',
keepAlive: true
},
component: () => import('@/view/data-base/supplierList')
},
supplierList.vue组件页面不需要做更改
如果想刷新页面可以添加监听路由事件
watch: {
 $route(to, from) {
 if (to.name === "supplierList") {//如果进入的页面name是supplierList
//获取后端数据渲染当前页面  也就是刷新页面
this.queryFun(true);
}
 }
}
 

相关文章:

  • 2022-12-23
  • 2021-11-22
  • 2022-12-23
  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-06-17
  • 2021-08-22
猜你喜欢
  • 2022-01-22
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-20
  • 2022-12-23
  • 2020-04-01
相关资源
相似解决方案