北京网站优化怎么样,电子商务网站有哪些类型,怎么自己办网站,做展厅 参考什么网站此文章讲诉在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进行截取即可解决