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

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

View File

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