From 0039a33026b65e4be662c6e733bf788306e5b8a9 Mon Sep 17 00:00:00 2001
From: riverflow <3011499946@qq.com>
Date: Sun, 10 Aug 2025 17:50:06 +0800
Subject: [PATCH 1/2] =?UTF-8?q?=E5=9C=A8layout=E6=96=87=E4=BB=B6=E5=A4=B9?=
=?UTF-8?q?=E4=B8=AD=E5=88=9B=E5=BB=BAheader=E6=96=87=E4=BB=B6=E5=A4=B9?=
=?UTF-8?q?=EF=BC=8C=E7=94=A8=E6=9D=A5=E5=AD=98=E6=94=BEheader=E5=8C=BA?=
=?UTF-8?q?=E5=9F=9F=E7=9B=B8=E5=85=B3=E7=BB=84=E4=BB=B6?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
在header文件夹中新建Header.vue、Collapse.vue、LoginOut.vue文件
分别对应头部整体区域、收缩按钮组件、退出登录组件
将Collapse.vue、LoginOut.vue引入Header.vue
为Header.vue配置样式
在layout.Index.vue主页引入Header.vue
对Index.vue中的header区域添加样式,分隔收缩图标和退出登录
---
order-system/src/layout/Index.vue | 17 +++++++++++++++--
order-system/src/layout/header/Collapse.vue | 13 +++++++++++++
order-system/src/layout/header/Header.vue | 20 ++++++++++++++++++++
order-system/src/layout/header/LoginOut.vue | 13 +++++++++++++
4 files changed, 61 insertions(+), 2 deletions(-)
create mode 100644 order-system/src/layout/header/Collapse.vue
create mode 100644 order-system/src/layout/header/Header.vue
create mode 100644 order-system/src/layout/header/LoginOut.vue
diff --git a/order-system/src/layout/Index.vue b/order-system/src/layout/Index.vue
index c9839d4..beeb70b 100644
--- a/order-system/src/layout/Index.vue
+++ b/order-system/src/layout/Index.vue
@@ -6,7 +6,11 @@
-
+
+
@@ -19,6 +23,9 @@
\ No newline at end of file
diff --git a/order-system/src/layout/header/Header.vue b/order-system/src/layout/header/Header.vue
new file mode 100644
index 0000000..0a4c281
--- /dev/null
+++ b/order-system/src/layout/header/Header.vue
@@ -0,0 +1,20 @@
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/order-system/src/layout/header/LoginOut.vue b/order-system/src/layout/header/LoginOut.vue
new file mode 100644
index 0000000..48c7041
--- /dev/null
+++ b/order-system/src/layout/header/LoginOut.vue
@@ -0,0 +1,13 @@
+
+
+ 退出登录
+
+
+
+
+
+
\ No newline at end of file
--
2.34.1
From 3e93e011b16115fa8e8267105489daee49d9218b Mon Sep 17 00:00:00 2001
From: riverflow <3011499946@qq.com>
Date: Sun, 10 Aug 2025 18:37:58 +0800
Subject: [PATCH 2/2] =?UTF-8?q?=E5=9C=A8store=E6=96=87=E4=BB=B6=E5=A4=B9?=
=?UTF-8?q?=E4=B8=AD=EF=BC=8C=E5=88=9B=E5=BB=BAcollapse=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=E5=A4=B9=EF=BC=8C=E4=BB=A5=E5=8F=8Aindex.ts=E6=96=87=E4=BB=B6?=
=?UTF-8?q?=20=E9=85=8D=E7=BD=AEindex.ts=E6=96=87=E4=BB=B6=EF=BC=8C?=
=?UTF-8?q?=E5=AD=98=E5=82=A8=E4=B8=80=E4=B8=AA=E5=B8=83=E5=B0=94=E5=80=BC?=
=?UTF-8?q?=EF=BC=8C=E7=94=A8=E6=9D=A5=E6=8E=A7=E5=88=B6=E5=9B=BE=E6=A0=87?=
=?UTF-8?q?=E5=8F=98=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
在vite-env.d.ts文件中配置store的导出
在layout.header/Collapse.vue中,添加动态组件
通过动态组件,实现图标点击事件
为图标添加点击事件,点击后store中存储的值取反,结合动态组件改变图标状态
ps:使用动态组件时,需要局部引入图标
---
order-system/src/layout/header/Collapse.vue | 36 +++++++++++++++++++--
order-system/src/store/collapse/index.ts | 25 ++++++++++++++
order-system/src/vite-env.d.ts | 3 ++
3 files changed, 61 insertions(+), 3 deletions(-)
create mode 100644 order-system/src/store/collapse/index.ts
diff --git a/order-system/src/layout/header/Collapse.vue b/order-system/src/layout/header/Collapse.vue
index ab02a2a..d853a9b 100644
--- a/order-system/src/layout/header/Collapse.vue
+++ b/order-system/src/layout/header/Collapse.vue
@@ -1,11 +1,41 @@
-
- 收缩图标
-
+
+
+
+
+
+
+