|
@@ -371,23 +371,9 @@ const router = new VueRouter({
|
|
}),
|
|
}),
|
|
routes: constantRoutes,
|
|
routes: constantRoutes,
|
|
})
|
|
})
|
|
-//注释的地方是允许路由重复点击,如果你觉得框架路由跳转规范太过严格可选择放开
|
|
|
|
-const originalPush = VueRouter.prototype.push
|
|
|
|
-VueRouter.prototype.push = function push(location, onResolve, onReject) {
|
|
|
|
- if (onResolve || onReject)
|
|
|
|
- return originalPush.call(this, location, onResolve, onReject)
|
|
|
|
- return originalPush.call(this, location).catch((err) => err)
|
|
|
|
-}
|
|
|
|
|
|
|
|
export function resetRouter() {
|
|
export function resetRouter() {
|
|
- router.matcher = new VueRouter({
|
|
|
|
- base: publicPath,
|
|
|
|
- mode: routerMode,
|
|
|
|
- scrollBehavior: () => ({
|
|
|
|
- y: 0,
|
|
|
|
- }),
|
|
|
|
- routes: constantRoutes,
|
|
|
|
- }).matcher
|
|
|
|
|
|
+ location.reload()
|
|
}
|
|
}
|
|
|
|
|
|
export default router
|
|
export default router
|