From 9c3e38a41dd44416c9e95f86eda3edab6df7d0be Mon Sep 17 00:00:00 2001 From: zhaowei <zhaowei> Date: 星期四, 10 七月 2025 10:28:23 +0800 Subject: [PATCH] 设备台账点击设备列表中的统一编码可以打开详情弹窗并带入行记录 --- src/router/index.js | 16 +++++++++++++++- 1 files changed, 15 insertions(+), 1 deletions(-) diff --git a/src/router/index.js b/src/router/index.js index bdbe374..8603811 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -4,8 +4,22 @@ Vue.use(Router) +// 瑙e喅鎶ラ敊 +const originalPush = Router.prototype.push +const originalReplace = Router.prototype.replace +// push +Router.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) +} +// replace +Router.prototype.replace = function push (location, onResolve, onReject) { + if (onResolve || onReject) return originalReplace.call(this, location, onResolve, onReject) + return originalReplace.call(this, location).catch(err => err) +} + export default new Router({ - mode: 'history', + mode: 'hash', base: process.env.BASE_URL, scrollBehavior: () => ({ y: 0 }), routes: constantRouterMap -- Gitblit v1.9.3