feat: 混合布局的左侧树关联

This commit is contained in:
wang_fan_w 2024-05-15 00:09:47 +08:00
parent 28db7e85a1
commit c31c15c244

View File

@ -84,6 +84,15 @@ const onMenuItem = (key: string) => {
const find = findLinearArray(key);
// 404
if (find) {
setAsideMenu(find);
router.push(find.path);
} else {
router.push("/404");
}
};
//
const setAsideMenu = (find: Menu.MenuOptions) => {
// chindren
if (find.children && find.children.length > 0) {
routeList.value = find.children;
@ -91,11 +100,15 @@ const onMenuItem = (key: string) => {
//
routeList.value = [find];
}
router.push(find.path);
} else {
router.push("/404");
}
};
//
const getAsideMenu = (key: string) => {
const { findLinearArray } = useRoutingMethod();
const find = findLinearArray(key);
setAsideMenu(find);
};
getAsideMenu(aciveRoute.value as string);
</script>
<style lang="scss" scoped>