From b36d32b66d27722bc50a92cea4177c7dbcc6f638 Mon Sep 17 00:00:00 2001 From: Jin Mao Date: Thu, 30 Oct 2025 23:27:53 +0800 Subject: [PATCH] =?UTF-8?q?chore(timezone):=20=E6=B7=BB=E5=8A=A0=20$reset?= =?UTF-8?q?=20=E6=96=B9=E6=B3=95=E5=B9=B6=E5=88=9D=E5=A7=8B=E5=8C=96?= =?UTF-8?q?=E6=97=B6=E5=8C=BA=E5=AD=98=E5=82=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在时区存储中添加 `$reset` 方法 -修复导入语句引号为双引号 - 优化时区初始化错误处理逻辑- 导出 `$reset` 方法以便外部调用- 确保时区设置与默认选项同步 - 提升代码一致性和可维护性 --- packages/stores/src/modules/timezone.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/stores/src/modules/timezone.ts b/packages/stores/src/modules/timezone.ts index c0b8873e..5e4e2d8c 100644 --- a/packages/stores/src/modules/timezone.ts +++ b/packages/stores/src/modules/timezone.ts @@ -1,9 +1,9 @@ -import { ref, unref } from 'vue'; +import { ref, unref } from "vue"; -import { DEFAULT_TIME_ZONE_OPTIONS } from '@vben-core/preferences'; -import { getTimezone, setDefaultTimezone } from '@vben-core/shared/utils'; +import { DEFAULT_TIME_ZONE_OPTIONS } from "@vben-core/preferences"; +import { getTimezone, setDefaultTimezone } from "@vben-core/shared/utils"; -import { acceptHMRUpdate, defineStore } from 'pinia'; +import { acceptHMRUpdate, defineStore } from "pinia"; interface TimezoneHandler { getTimezone?: () => Promise; @@ -102,11 +102,14 @@ const useTimezoneStore = defineStore( initTimezone().catch((error) => { console.error('Failed to initialize timezone during store setup:', error); }); + function $reset() { + } return { timezone: timezoneRef, setTimezone, getTimezoneOptions, + $reset }; }, {