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] =?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 @@