diff --git a/src/router/index.js b/src/router/index.js index 6e6c116a..97b51fa5 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -2,7 +2,14 @@ import Vue from 'vue' import Router from 'vue-router' Vue.use(Router) - +const RouterPush = Router.prototype.push +Router.prototype.push = function push (to) { + return RouterPush.call(this, to).catch(err => err) +} +const RouterReplace = Router.prototype.replace +Router.prototype.replace = function replace (to) { + return RouterReplace.call(this, to).catch(err => err) +} /* Layout */ import Layout from '@/layout' import ParentView from '@/components/ParentView'; @@ -305,5 +312,6 @@ export const constantRoutes = [ export default new Router({ mode: 'history', // 去掉url中的# scrollBehavior: () => ({ y: 0 }), - routes: constantRoutes + routes: constantRoutes, + ignoreDuplicates: true }) diff --git a/src/views/bigScreenIframe/index.vue b/src/views/bigScreenIframe/index.vue index 1f15e438..4c20d972 100644 --- a/src/views/bigScreenIframe/index.vue +++ b/src/views/bigScreenIframe/index.vue @@ -5,6 +5,7 @@