Open small-dots opened 2 years ago
对于多级路由嵌套使keep-alive失效的情况,在src下面的permission.js文件中加入下面代码: router.beforeResolve((to, from, next) => { if (to.matched && to.matched.length > 2) { to.matched.splice(1, to.matched.length - 2) } next() }) 这样做就相当于让matched匹配的路由始终都是2个,tags-view导航就能缓存所有打开的页面了。 这样做会影响到面包屑导航: 下面是给出一个解决方案 1.recursiveTreeByLastLevel方法: /**
Question(提问)
Screenshot or Gif(截图或动态图)
正对这种方案 能给点思路吗