From 33bb16a0d3776c49098697cafbe88a2725e73c1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?lemon=E6=A9=AA?= <17633066053@163.com> Date: Fri, 4 Mar 2022 15:12:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=8F=9C=E5=8D=95=E6=A0=8F?= =?UTF-8?q?=E9=87=8D=E5=A4=8D=E7=82=B9=E5=87=BBconsole=E4=BC=9A=E6=98=BE?= =?UTF-8?q?=E7=A4=BAbug=20=EF=BC=8C=20=E4=BB=A5=E5=8F=8A=E8=A1=8C=E6=94=BF?= =?UTF-8?q?=E5=9C=B0=E5=8C=BA=E4=B8=8D=E5=9B=9E=E6=98=BE=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/router/index.js | 8 ++++++ manager/src/router/index.js | 10 ++++++++ manager/src/views/region/index.vue | 41 +++++++++++++++++++----------- seller/src/router/index.js | 8 ++++++ 4 files changed, 52 insertions(+), 15 deletions(-) diff --git a/buyer/src/router/index.js b/buyer/src/router/index.js index 80251a22..5dfb92eb 100644 --- a/buyer/src/router/index.js +++ b/buyer/src/router/index.js @@ -97,6 +97,14 @@ const ShopEntry = (resolve) => Vue.use(Router); +/** + * 解决重复点击菜单会控制台报错bug + */ + const routerPush = Router.prototype.push + Router.prototype.push = function push(location) { + return routerPush.call(this, location).catch(error=> error) + } + export default new Router({ mode: "history", routes: [ diff --git a/manager/src/router/index.js b/manager/src/router/index.js index 4064391d..3d4484c3 100644 --- a/manager/src/router/index.js +++ b/manager/src/router/index.js @@ -13,6 +13,14 @@ const RouterConfig = { routes: routers }; +/** + * 解决重复点击菜单会控制台报错bug + */ +const routerPush = VueRouter.prototype.push +VueRouter.prototype.push = function push(location) { + return routerPush.call(this, location).catch(error=> error) +} + export const router = new VueRouter(RouterConfig); router.beforeEach((to, from, next) => { @@ -44,3 +52,5 @@ router.afterEach((to) => { ViewUI.LoadingBar.finish(); window.scrollTo(0, 0); }); + + diff --git a/manager/src/views/region/index.vue b/manager/src/views/region/index.vue index a3e5b5c6..64d46a71 100644 --- a/manager/src/views/region/index.vue +++ b/manager/src/views/region/index.vue @@ -1,7 +1,11 @@