From 1a70561f7cc247398fefdd64fbc04fb362109615 Mon Sep 17 00:00:00 2001 From: ivamp Date: Sat, 3 Aug 2024 16:13:48 +0800 Subject: [PATCH] =?UTF-8?q?```=20=E5=B0=86=E5=AF=BC=E8=88=AA=E6=8A=BD?= =?UTF-8?q?=E5=B1=89=E7=8A=B6=E6=80=81=E7=AE=A1=E7=90=86=E8=BF=81=E7=A7=BB?= =?UTF-8?q?=E5=88=B0Pinia=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 导航抽屉的打开/关闭状态之前是在组件中通过一个本地ref管理的。为了提高状态管理的一致性和可维护性,此状态现被移至Pinia存储中进行集中管理。在AppBar.vue组件中,导航抽屉状态的引用和操作已被更新,以使用新的Pinia存储逻辑。此更改还将有助于在将来跨组件或页面共享导航抽屉状态时提供更便捷的访问。 ``` --- src/components/AppBar.vue | 16 +++++++++++----- src/stores/app.ts | 3 ++- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/src/components/AppBar.vue b/src/components/AppBar.vue index 6663d76..ba2e885 100644 --- a/src/components/AppBar.vue +++ b/src/components/AppBar.vue @@ -1,9 +1,13 @@ diff --git a/src/stores/app.ts b/src/stores/app.ts index 650dce6..c5259d4 100644 --- a/src/stores/app.ts +++ b/src/stores/app.ts @@ -2,7 +2,8 @@ import { defineStore } from "pinia"; export const useAppStore = defineStore("app", { + persist: true, state: () => ({ - // + navigation_drawer: false, }), });