2 Commits

Author SHA1 Message Date
疯狂的狮子Li
ad7058b739 !236 update 收起菜单时从展开列表中移除对应菜单
Merge pull request !236 from Lau/dev
2025-08-14 01:17:48 +00:00
lau
0dd5044bbe update 收起菜单时从展开列表中移除对应菜单 2025-08-14 09:07:35 +08:00

View File

@@ -44,6 +44,7 @@
:default-expand-all="false"
lazy
:load="getChildrenList"
:expand-change="expandMenuHandle"
>
<el-table-column prop="menuName" label="菜单名称" :show-overflow-tooltip="true" width="160"></el-table-column>
<el-table-column prop="icon" label="图标" align="center" width="100">
@@ -353,6 +354,13 @@ const getChildrenList = async (row: any, treeNode: unknown, resolve: (data: any[
resolve(children);
};
/** 收起菜单时从menuExpandMap中删除对应菜单id数据 */
const expandMenuHandle = async (row: any, expanded: boolean) => {
if (!expanded) {
menuExpandMap.value[row.menuId] = undefined;
}
};
/** 刷新展开的菜单数据 */
const refreshLoadTree = (parentId: string | number) => {
if (menuExpandMap.value[parentId]) {