From b2317e32095856962cc4b4f20fcf252e33e3a98b Mon Sep 17 00:00:00 2001 From: iczer <1126263215@qq.com> Date: Wed, 12 Aug 2020 13:19:29 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20the=20problem=20that=20select=20events?= =?UTF-8?q?=20can't=20be=20triggered=20in=20menu.js=20component;=20:bug:?= =?UTF-8?q?=20#99=20=E4=BF=AE=E5=A4=8D=EF=BC=9Amenu.js=20=E7=BB=84?= =?UTF-8?q?=E4=BB=B6=E4=B8=AD=20select=20=E4=BA=8B=E4=BB=B6=E6=97=A0?= =?UTF-8?q?=E6=B3=95=E8=A7=A6=E5=8F=91=E7=9A=84=E9=97=AE=E9=A2=98=EF=BC=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/menu/menu.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/menu/menu.js b/src/components/menu/menu.js index dd60a93..ddab46e 100644 --- a/src/components/menu/menu.js +++ b/src/components/menu/menu.js @@ -175,7 +175,9 @@ export default { updateMenu () { const menuRoutes = this.$route.matched.filter(item => item.path !== '') const route = menuRoutes.pop() - this.selectedKeys = [this.getSelectedKey(route)] + if(this.selectedKeys.length === 0 || route.meta.invisible) { + this.selectedKeys = [this.getSelectedKey(route)] + } let openKeys = menuRoutes.map(item => item.path) if (!fastEqual(openKeys, this.sOpenKeys)) { this.collapsed || this.mode === 'horizontal' ? this.cachedOpenKeys = openKeys : this.sOpenKeys = openKeys