瀏覽代碼

fix:SMenu horizontal

kokoroli 6 年之前
父節點
當前提交
185d31ac31
共有 1 個文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/components/menu/index.js

+ 6 - 0
src/components/menu/index.js

@@ -59,6 +59,12 @@ export default {
   methods: {
     // select menu item
     onOpenChange (openKeys) {
+      // 在水平模式下时执行,并且不再执行后续
+      if (this.mode === 'horizontal') {
+        this.openKeys = openKeys
+        return
+      }
+      // 非水平模式时
       const latestOpenKey = openKeys.find(key => !this.openKeys.includes(key))
       if (!this.rootSubmenuKeys.includes(latestOpenKey)) {
         this.openKeys = openKeys