diff --git a/src/layouts/BasicLayout/index.vue b/src/layouts/BasicLayout/index.vue
index 0267e79..79c7346 100644
--- a/src/layouts/BasicLayout/index.vue
+++ b/src/layouts/BasicLayout/index.vue
@@ -5,23 +5,46 @@
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
- Ench admin
+
+ {{ appStore.title }}
+
diff --git a/src/layouts/components/Breadcrumb.vue b/src/layouts/components/header/Breadcrumb.vue
similarity index 92%
rename from src/layouts/components/Breadcrumb.vue
rename to src/layouts/components/header/Breadcrumb.vue
index f2c2933..fa16463 100644
--- a/src/layouts/components/Breadcrumb.vue
+++ b/src/layouts/components/header/Breadcrumb.vue
@@ -1,5 +1,5 @@
-
+
首页
@@ -14,7 +14,6 @@
+
+
diff --git a/src/layouts/components/header/FullScreen.vue b/src/layouts/components/header/FullScreen.vue
new file mode 100644
index 0000000..833555b
--- /dev/null
+++ b/src/layouts/components/header/FullScreen.vue
@@ -0,0 +1,21 @@
+
+
+
+
+
+
+
+
+ 全屏
+
+
+
+
+
+
diff --git a/src/layouts/components/header/Github.vue b/src/layouts/components/header/Github.vue
new file mode 100644
index 0000000..949b483
--- /dev/null
+++ b/src/layouts/components/header/Github.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+ Github
+
+
+
+
+
+
diff --git a/src/layouts/components/header/Notices.vue b/src/layouts/components/header/Notices.vue
new file mode 100644
index 0000000..e797817
--- /dev/null
+++ b/src/layouts/components/header/Notices.vue
@@ -0,0 +1,18 @@
+
+
+
+
+
+
+
+ 消息通知
+
+
+
+
+
+
diff --git a/src/layouts/components/header/Setting.vue b/src/layouts/components/header/Setting.vue
new file mode 100644
index 0000000..ee91fbc
--- /dev/null
+++ b/src/layouts/components/header/Setting.vue
@@ -0,0 +1,26 @@
+
+
+
+
+
+
+ 这是系统设置,但是暂时还没有内容
+
+
+
+ 设置
+
+
+
+
+
+
diff --git a/src/layouts/components/header/UserCenter.vue b/src/layouts/components/header/UserCenter.vue
new file mode 100644
index 0000000..efd4ada
--- /dev/null
+++ b/src/layouts/components/header/UserCenter.vue
@@ -0,0 +1,37 @@
+
+
+ Admin chen
+
+
+
+
+
+
diff --git a/src/layouts/components/index.ts b/src/layouts/components/index.ts
index 7ff9802..48624a7 100644
--- a/src/layouts/components/index.ts
+++ b/src/layouts/components/index.ts
@@ -1,6 +1,15 @@
-import Breadcrumb from './Breadcrumb.vue';
-import CollapaseButton from './CollapaseButton.vue';
-import Logo from './Logo.vue';
-import Menu from './Menu.vue';
+/* 侧边栏组件 */
+import Logo from './sider/Logo.vue';
+import Menu from './sider/Menu.vue';
-export { Breadcrumb, CollapaseButton, Menu, Logo };
+/* 头部栏组件 */
+import Breadcrumb from './header/Breadcrumb.vue';
+import CollapaseButton from './header/CollapaseButton.vue';
+import FullScreen from './header/FullScreen.vue';
+import DarkMode from './header/DarkMode.vue';
+import Setting from './header/Setting.vue';
+import Github from './header/Github.vue';
+import Notices from './header/Notices.vue';
+import UserCenter from './header/UserCenter.vue';
+
+export { Breadcrumb, CollapaseButton, Menu, Logo, FullScreen, DarkMode, Setting, Github, Notices, UserCenter };
diff --git a/src/layouts/components/Logo.vue b/src/layouts/components/sider/Logo.vue
similarity index 100%
rename from src/layouts/components/Logo.vue
rename to src/layouts/components/sider/Logo.vue
diff --git a/src/layouts/components/Menu.vue b/src/layouts/components/sider/Menu.vue
similarity index 96%
rename from src/layouts/components/Menu.vue
rename to src/layouts/components/sider/Menu.vue
index 9941399..1354ccd 100644
--- a/src/layouts/components/Menu.vue
+++ b/src/layouts/components/sider/Menu.vue
@@ -23,7 +23,7 @@ function renderIcon(icon: string) {
return () => h(Icon, { icon });
}
-const handleClickMenu = (key: string, _item: MenuOption) => {
+const handleClickMenu = (key: string) => {
router.push(key);
};
const menuOptions: MenuOption[] = [
diff --git a/src/store/modules/app.ts b/src/store/modules/app.ts
index 07a53a9..87c138d 100644
--- a/src/store/modules/app.ts
+++ b/src/store/modules/app.ts
@@ -4,12 +4,29 @@ export const useApp = defineStore('app-store', {
state: () => {
return {
collapsed: false,
+ fullScreen: false,
+ darkMode: false,
title: import.meta.env.VITE_APP_TITLE,
};
},
actions: {
- switchCollapse() {
+ /* 切换侧边栏收缩 */
+ toggleCollapse() {
this.collapsed = !this.collapsed;
},
+ /* 切换全屏 */
+ toggleFullScreen() {
+ if (!document.fullscreenElement) {
+ this.fullScreen = true;
+ document.documentElement.requestFullscreen();
+ } else if (document.exitFullscreen) {
+ this.fullScreen = false;
+ document.exitFullscreen();
+ }
+ },
+ /* 切换主题 亮/深色 */
+ toggleDarkMode() {
+ this.darkMode = !this.darkMode;
+ },
},
});