From 9e7a03fcd84640001f0faf439f0e21eb243ca31e Mon Sep 17 00:00:00 2001 From: chenghongxing <1126263215@qq.com> Date: Sun, 22 Nov 2020 17:17:06 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=EF=BC=9A=E8=8F=9C=E5=8D=95?= =?UTF-8?q?=E7=BB=84=E4=BB=B6=20openChang=20=E4=BA=8B=E4=BB=B6=E7=9A=84=20?= =?UTF-8?q?bug=EF=BC=9B:bug:=20#156=20fix:=20the=20problem=20of=20openChan?= =?UTF-8?q?ge=20event=20in=20menu.js;?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/menu/menu.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/components/menu/menu.js b/src/components/menu/menu.js index e560e97..87075a9 100644 --- a/src/components/menu/menu.js +++ b/src/components/menu/menu.js @@ -200,9 +200,10 @@ export default { }) }, updateMenu () { - const menuRoutes = this.$route.matched.filter(item => item.path !== '') + const matchedRoutes = this.$route.matched.filter(item => item.path !== '') this.selectedKeys = this.getSelectedKey(this.$route) - let openKeys = menuRoutes.map(item => item.path) + let openKeys = matchedRoutes.map(item => item.path) + openKeys = openKeys.slice(0, openKeys.length -1) if (!fastEqual(openKeys, this.sOpenKeys)) { this.collapsed || this.mode === 'horizontal' ? this.cachedOpenKeys = openKeys : this.sOpenKeys = openKeys }