Explorar el Código

fix(@six/health-remedy):修复移动端二级菜单点击不收起

张田田 hace 3 semanas
padre
commit
1089d3fca3
Se han modificado 1 ficheros con 4 adiciones y 1 borrados
  1. 4 1
      packages/@core/ui-kit/menu-ui/src/components/menu.vue

+ 4 - 1
packages/@core/ui-kit/menu-ui/src/components/menu.vue

@@ -248,6 +248,9 @@ function handleMenuItemClick(data: MenuItemClicked) {
   const { collapse, mode } = props;
   if (mode === 'horizontal' || collapse) {
     openedMenus.value = [];
+    setTimeout(() => {
+      openedMenus.value = [];
+    }, 100);
   }
   const { parentPaths, path } = data;
   if (!path || !parentPaths) {
@@ -259,7 +262,6 @@ function handleMenuItemClick(data: MenuItemClicked) {
 
 function handleSubMenuClick({ parentPaths, path }: MenuItemRegistered) {
   const isOpened = openedMenus.value.includes(path);
-
   if (isOpened) {
     closeMenu(path, parentPaths);
   } else {
@@ -279,6 +281,7 @@ function close(path: string) {
  * 关闭、折叠菜单
  */
 function closeMenu(path: string, parentPaths: string[]) {
+  console.log(path, parentPaths, 'closeMenu', props);
   if (props.accordion) {
     openedMenus.value = subMenus.value[path]?.parentPaths ?? [];
   }