children117cl
2021-05-31 308c34038375c64f94c07a92736cb167568359e6
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()