Эх сурвалжийг харах

NavMenu: fix click el-submenu trigger childMenu pop again bug (#14443)

花裤衩 6 жил өмнө
parent
commit
56e3e1f56a

+ 5 - 4
packages/menu/src/submenu.vue

@@ -178,7 +178,8 @@
         }
         this.dispatch('ElMenu', 'submenu-click', this);
       },
-      handleMouseenter(event) {
+      handleMouseenter(event, showTimeout = this.showTimeout) {
+
         if (!('ActiveXObject' in window) && event.type === 'focus' && !event.relatedTarget) {
           return;
         }
@@ -194,7 +195,7 @@
         clearTimeout(this.timeout);
         this.timeout = setTimeout(() => {
           this.rootMenu.openMenu(this.index, this.indexPath);
-        }, this.showTimeout);
+        }, showTimeout);
       },
       handleMouseleave() {
         const {rootMenu} = this;
@@ -274,9 +275,9 @@
             ref="menu"
             v-show={opened}
             class={[`el-menu--${mode}`, popperClass]}
-            on-mouseenter={this.handleMouseenter}
+            on-mouseenter={($event) => this.handleMouseenter($event, 100)}
             on-mouseleave={this.handleMouseleave}
-            on-focus={this.handleMouseenter}>
+            on-focus={($event) => this.handleMouseenter($event, 100)}>
             <ul
               role="menu"
               class={['el-menu el-menu--popup', `el-menu--popup-${currentPlacement}`]}