后台管理菜单列表三级菜单无法缓存组件问题,根本原因是在于keep-alive本身存在的缺陷,需要在路由守卫中将matched属性做一下优化,具体如下
Router.beforeEach((to, from, next)=>{
if(to.matched && to.matched.length>2){
to.matched.splice(1,to.matched.length -2)
}
next()
})
在路由勾子上添加如上代码解决keep-alive缓存问题