mirror of
https://github.com/PlayEdu/backend
synced 2025-06-10 10:34:10 +08:00
左侧菜单优化
This commit is contained in:
parent
0e6435a472
commit
bc33b7c34f
@ -68,6 +68,9 @@ const items = [
|
|||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
||||||
|
export const LeftMenu: React.FC = () => {
|
||||||
|
const location = useLocation();
|
||||||
|
const navigate = useNavigate();
|
||||||
const children2Parent: any = {
|
const children2Parent: any = {
|
||||||
"^/video": ["resource"],
|
"^/video": ["resource"],
|
||||||
"^/image": ["resource"],
|
"^/image": ["resource"],
|
||||||
@ -77,10 +80,6 @@ const children2Parent: any = {
|
|||||||
"^/system": ["system"],
|
"^/system": ["system"],
|
||||||
};
|
};
|
||||||
|
|
||||||
export const LeftMenu: React.FC = () => {
|
|
||||||
const location = useLocation();
|
|
||||||
const navigate = useNavigate();
|
|
||||||
|
|
||||||
const hit = (pathname: string): string[] => {
|
const hit = (pathname: string): string[] => {
|
||||||
for (let p in children2Parent) {
|
for (let p in children2Parent) {
|
||||||
if (pathname.search(p) >= 0) {
|
if (pathname.search(p) >= 0) {
|
||||||
@ -104,7 +103,6 @@ export const LeftMenu: React.FC = () => {
|
|||||||
}
|
}
|
||||||
newOpenKeys.push(openKeys[i]);
|
newOpenKeys.push(openKeys[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
return newOpenKeys;
|
return newOpenKeys;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user