Skip to content

Commit 185d31a

Browse files
committed
fix:SMenu horizontal
1 parent 17d892c commit 185d31a

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/components/menu/index.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,12 @@ export default {
5959
methods: {
6060
// select menu item
6161
onOpenChange (openKeys) {
62+
// 在水平模式下时执行,并且不再执行后续
63+
if (this.mode === 'horizontal') {
64+
this.openKeys = openKeys
65+
return
66+
}
67+
// 非水平模式时
6268
const latestOpenKey = openKeys.find(key => !this.openKeys.includes(key))
6369
if (!this.rootSubmenuKeys.includes(latestOpenKey)) {
6470
this.openKeys = openKeys

0 commit comments

Comments
 (0)