fix: delay issue in the theme settings tab switch (#4240)

#### What type of PR is this?

/area console
/kind bug
/milestone 2.8.x

#### What this PR does / why we need it:

修复主题设置选项卡切换的延迟问题。

#### Which issue(s) this PR fixes:

Fixes #4239 

#### Special notes for your reviewer:

需要测试:

1. 进入主题设置,尝试对设置选项卡进行切换,观察选项卡和实际的设置表单是否一致。

#### Does this PR introduce a user-facing change?

```release-note
None
```
pull/4246/head^2
Ryan Wang 2023-07-19 11:26:13 +08:00 committed by GitHub
parent 1dc2f6f4ea
commit 53b8ccb7c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -10,7 +10,6 @@ import type { Ref } from "vue";
import type { ConfigMap, Setting, Theme } from "@halo-dev/api-client";
// hooks
import { useRouteParams } from "@vueuse/router";
import { apiClient } from "@/utils/api-client";
import { useSettingFormConvert } from "@/composables/use-setting-form";
import { useI18n } from "vue-i18n";
@ -19,7 +18,7 @@ import { useQuery, useQueryClient } from "@tanstack/vue-query";
const { t } = useI18n();
const queryClient = useQueryClient();
const group = useRouteParams<string>("group");
const group = inject<Ref<string>>("activeTab", ref(""));
const selectedTheme = inject<Ref<Theme | undefined>>("selectedTheme");
const setting = inject<Ref<Setting | undefined>>("setting", ref());

View File

@ -66,6 +66,7 @@ const selectedTheme = ref<Theme>();
const themesModal = ref(false);
const previewModal = ref(false);
const activeTab = ref(tabs.value[0].id);
provide<Ref<string>>("activeTab", activeTab);
const { loading, isActivated, handleActiveTheme } =
useThemeLifeCycle(selectedTheme);