湖南网站制作团队,高新区网站建设的建议,wordpress 文章背景色,做食品团购去那家网站好此文章讲诉在vue中使用keep-alive缓存#xff0c;三级路由缓存失败处理方案。 一二级路由缓存无任何问题#xff0c;三级以上就会失败#xff0c;因此我们在路由守卫中对matched做出如下优化 Router.beforeEach((to, from, next){if(to.matched to.matched.l… 此文章讲诉在vue中使用keep-alive缓存三级路由缓存失败处理方案。 一二级路由缓存无任何问题三级以上就会失败因此我们在路由守卫中对matched做出如下优化 Router.beforeEach((to, from, next){if(to.matched to.matched.length2){to.matched.splice(1,to.matched.length -2)}next()
})在路由拦截中对matched进行截取即可解决