初志鑫 4 년 전
부모
커밋
60dadc23c2
1개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 5 3
      src/router/index.js

+ 5 - 3
src/router/index.js

@@ -488,10 +488,12 @@ const router = new VueRouter({
   routes: constantRoutes,
 });
 //注释的地方是允许路由重复点击,如果你觉得框架路由跳转规范太过严格可选择放开
-/*const originalPush = VueRouter.prototype.push;
-VueRouter.prototype.push = function push(location) {
+/* 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({