From 51bea86137377f1877c7f656d3d1a1104f3e79b5 Mon Sep 17 00:00:00 2001 From: dengbf Date: Thu, 29 Feb 2024 10:38:31 +0800 Subject: [PATCH] =?UTF-8?q?-=20[=E4=BF=AE=E5=A4=8D]=20=E6=A8=A1=E5=9D=97?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E6=97=B6=EF=BC=8C=E5=BC=B9=E5=87=BA=E5=A4=9A?= =?UTF-8?q?=E4=B8=AA=E6=95=B0=E6=8D=AE=E4=BF=9D=E6=8C=81=E7=AA=97=E5=8F=A3?= =?UTF-8?q?=20=20=20=20-=20[#[1083909826117632]=E5=B7=A5=E5=8D=95=E4=B8=8A?= =?UTF-8?q?=E6=8A=A5-=E5=9C=A8=E4=B8=8A=E6=8A=A5=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=EF=BC=8C=E7=82=B9=E5=87=BBit=E6=9C=8D=E5=8A=A1=E8=B7=B3?= =?UTF-8?q?=E8=BD=AC=E5=87=BA=E5=8E=BB=EF=BC=8C=E5=87=BA=E7=8E=B0=E4=B8=89?= =?UTF-8?q?=E5=B1=82=E4=BF=9D=E5=AD=98=E6=8F=90=E7=A4=BA=E5=BC=B9=E7=AA=97?= =?UTF-8?q?=20http://192.168.0.96:8090/demo/rdm.html#/bug-detail/939050947?= =?UTF-8?q?543040/939050947543057/1083909826117632]?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/components/topnav/topnav-menu.vue | 22 +++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/src/views/components/topnav/topnav-menu.vue b/src/views/components/topnav/topnav-menu.vue index 9385ae8c..114a5c05 100644 --- a/src/views/components/topnav/topnav-menu.vue +++ b/src/views/components/topnav/topnav-menu.vue @@ -78,31 +78,37 @@ export default { }, toMenu(module, path = '/') { this.isShow = false; + this.moduleId = module; document.querySelector('.topnav-menu-list').style.display = 'none'; + if (document.querySelector(`#tab_${module}`)) { + document.querySelector(`#tab_${module}`).setAttribute('href', 'javascript:void(0)'); + } this.$route.meta.clearHistory = true; if (module === MODULEID) { this.$router.push(path); } else { let that = this.$root.$children[0] ? this.$root.$children[0].$refs.root : null;//获取router-view 的vue 对象 - // console.log(module, path, '----', that, `${HOME}/${module}.html#${path}`); this.$utils.gotoHref(`${HOME}/${module}.html#${path}`, that); } + this.$nextTick(() => { + //出现数据保存弹框时,确保选中模块与当前模块保持一致 + this.moduleId = MODULEID; + }); }, newTab(e, module) { //鼠标右键打开新标签页 - let replaceStr = `${module.moduleName}`; + let replaceStr = `${module.moduleName}`; e.currentTarget.innerHTML = replaceStr; }, renderLabel(module) { return h => { return h( - 'a', + 'div', { - domProps: { - href: HOME + '/' + module.moduleId + '.html#/' - }, - style: { - display: 'block' + on: { + contextmenu: ($event) => { + this.newTab($event, module); + } } }, module.moduleName ); -- Gitee