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