ソースを参照

fix resetRouter

vue-admin-beautiful.com 3 年 前
コミット
9e4b4cfb87
3 ファイル変更2 行追加19 行削除
  1. 0 3
      README.md
  2. 1 1
      package.json
  3. 1 15
      src/router/index.js

+ 0 - 3
README.md

@@ -1,8 +1,5 @@
 <div align="center"><img width="200" src="https://gitee.com/chu1204505056/image/raw/master/logo/vab.svg"/>
 <h1> vue-admin-beautiful-pro(element-ui) </h1>
-<p>程序无国界,但程序员有国界,中国国家尊严不容挑衅,如果您在特殊时期继续购买HM、耐克、阿迪达斯等品牌那么您将无权继续使用Vab</p>
-<p>Programs have no borders, but programmers have borders. China's national dignity can not be challenged. If you continue to buy HM, Nike, Adidas and other brands in a special period, you will not have the right to continue to use Vab
-</p>
 </div>
 
 [![Website](<https://img.shields.io/badge/ good luck - vue admin beautiful -blue?style=flat-square>)](https://vue-admin-beautiful.com)

+ 1 - 1
package.json

@@ -41,7 +41,7 @@
   "dependencies": {
     "axios": "^0.21.1",
     "clipboard": "^2.0.8",
-    "core-js": "^3.15.1",
+    "core-js": "^3.15.2",
     "dayjs": "^1.10.5",
     "echarts": "^5.1.2",
     "element-ui": "^2.15.3",

+ 1 - 15
src/router/index.js

@@ -371,23 +371,9 @@ const router = new VueRouter({
   }),
   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() {
-  router.matcher = new VueRouter({
-    base: publicPath,
-    mode: routerMode,
-    scrollBehavior: () => ({
-      y: 0,
-    }),
-    routes: constantRoutes,
-  }).matcher
+  location.reload()
 }
 
 export default router