src/router/index.js | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
src/router/index.js
@@ -101,6 +101,17 @@ const router = createRouter() // 守卫,处理keepAlive周期,用isBack标记是否属于从属页面后退 router.beforeEach(function(to, from, next) { // 判断是否从从属页面后退 if (to.meta.keepAlive && from.meta.activeMenu === to.path) { to.meta.isBack = true } else { to.meta.isBack = false } next(true) }) // Detail see: https://github.com/vuejs/vue-router/issues/1234#issuecomment-357941465 export function resetRouter() { const newRouter = createRouter()