chore: 🔨 注释和命名优化

This commit is contained in:
郝先瑞
2024-02-22 23:14:05 +08:00
parent 56996ff213
commit e19dfe9922

View File

@@ -1,7 +1,7 @@
<!-- 侧边菜单包括左侧布局(all)顶部布局(all)混合布局(left) --> <!-- 侧边菜单包括左侧布局(left)顶部布局(all)混合布局(left) -->
<template> <template>
<el-menu <el-menu
:default-active="currRoute.path" :default-active="currentRoute.path"
:collapse="!appStore.sidebar.opened" :collapse="!appStore.sidebar.opened"
:background-color="variables['menu-background']" :background-color="variables['menu-background']"
:text-color="variables['menu-text']" :text-color="variables['menu-text']"
@@ -28,7 +28,7 @@ import variables from "@/styles/variables.module.scss";
const settingsStore = useSettingsStore(); const settingsStore = useSettingsStore();
const appStore = useAppStore(); const appStore = useAppStore();
const currRoute = useRoute(); const currentRoute = useRoute();
const layout = computed(() => settingsStore.layout); const layout = computed(() => settingsStore.layout);
const props = defineProps({ const props = defineProps({
menuList: { menuList: {
@@ -47,7 +47,7 @@ const props = defineProps({
/** /**
* 解析路径 * 解析路径
* *
* @param routePath 路由路径 * @param routePath 路由路径 /user
*/ */
function resolvePath(routePath: string) { function resolvePath(routePath: string) {
if (isExternal(routePath)) { if (isExternal(routePath)) {
@@ -57,8 +57,8 @@ function resolvePath(routePath: string) {
return props.basePath; return props.basePath;
} }
// 完整路径 = 父级路径(/level/level_3) + 路由路径 // 完整绝对路径 = 父级路径(/system) + 路由路径(/user)
const fullPath = path.resolve(props.basePath, routePath); // 相对路径 → 绝对路径 const fullPath = path.resolve(props.basePath, routePath);
return fullPath; return fullPath;
} }
</script> </script>