diff --git a/.editorconfig b/.editorconfig
index dd765724..00ee2de4 100644
--- a/.editorconfig
+++ b/.editorconfig
@@ -5,7 +5,8 @@ root = true
[*]
charset = utf-8 # 设置文件字符集为 utf-8
end_of_line = lf # 控制换行类型(lf | cr | crlf)
-indent_style = tab # 缩进风格(tab | space)
+indent_style = space # 缩进风格(tab | space)
+indent_size = 2 # 缩进大小
insert_final_newline = true # 始终在文件末尾插入一个新行
# 表示仅 md 文件适用以下规则
diff --git a/.eslintrc.cjs b/.eslintrc.cjs
index 3300699c..69c2fc75 100644
--- a/.eslintrc.cjs
+++ b/.eslintrc.cjs
@@ -64,6 +64,12 @@ module.exports = {
},
],
"vue/multi-word-component-names": "off",
+ "prettier/prettier": [
+ "error",
+ {
+ useTabs: false, // 不使用制表符
+ },
+ ],
},
// eslint不能对html文件生效
overrides: [
diff --git a/src/layout/components/Sidebar/LeftMenu.vue b/src/layout/components/Sidebar/LeftMenu.vue
new file mode 100644
index 00000000..16d13282
--- /dev/null
+++ b/src/layout/components/Sidebar/LeftMenu.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
diff --git a/src/layout/components/Sidebar/SidebarItem.vue b/src/layout/components/Sidebar/SidebarItem.vue
index 06ebf71d..d932eeb1 100644
--- a/src/layout/components/Sidebar/SidebarItem.vue
+++ b/src/layout/components/Sidebar/SidebarItem.vue
@@ -54,6 +54,7 @@ function hasOneShowingChild(children = [], parent: any) {
// 2:如果无子路由, 复制当前路由信息作为其子路由,满足只拥有一个子路由的条件,所以返回 true
if (showingChildren.length === 0) {
onlyOneChild.value = { ...parent, path: "", noShowingChildren: true };
+
return true;
}
return false;
@@ -71,6 +72,7 @@ function resolvePath(routePath: string) {
if (isExternal(props.basePath)) {
return props.basePath;
}
+
// 完整路径 = 父级路径(/level/level_3) + 路由路径
const fullPath = path.resolve(props.basePath, routePath); // 相对路径 → 绝对路径
return fullPath;
diff --git a/src/layout/components/Sidebar/TopMenu.vue b/src/layout/components/Sidebar/TopMenu.vue
new file mode 100644
index 00000000..39c68628
--- /dev/null
+++ b/src/layout/components/Sidebar/TopMenu.vue
@@ -0,0 +1,78 @@
+
+
+
+
+
+
+
+ 首页
+
+
+ {{ translateRouteTitleI18n(route.meta.title) }}
+
+
+
+
+
+
+
+
+
diff --git a/src/layout/components/Sidebar/index.vue b/src/layout/components/Sidebar/index.vue
index 3eb734ae..fc499bcf 100644
--- a/src/layout/components/Sidebar/index.vue
+++ b/src/layout/components/Sidebar/index.vue
@@ -1,18 +1,15 @@
-