fix: system settings form could not be loaded (#787)

#### What type of PR is this?

/kind bug

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

修复系统设置页面切换选项卡无法正常加载表单的问题。

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

Fixes https://github.com/halo-dev/halo/issues/3001

#### Special notes for your reviewer:

测试方式:

1. 测试系统设置页面的选项卡切换和保存功能。

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

```release-note
修复 Console 端系统设置页面切换选项卡无法正常加载表单的问题。
```
pull/790/head
Ryan Wang 2022-12-20 19:44:29 +08:00 committed by GitHub
parent ca4749432e
commit ed07cd2958
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 35 additions and 32 deletions

View File

@ -33,6 +33,7 @@ await handleFetchSettings();
await handleFetchConfigMap();
</script>
<template>
<Transition mode="out-in" name="fade">
<div class="bg-white p-4">
<div>
<FormKit
@ -45,7 +46,10 @@ await handleFetchConfigMap();
type="form"
@submit="handleSaveConfigMap"
>
<FormKitSchema :schema="formSchema" :data="configMapFormData[group]" />
<FormKitSchema
:schema="formSchema"
:data="configMapFormData[group]"
/>
</FormKit>
</div>
<div v-permission="['system:configmaps:manage']" class="pt-5">
@ -60,4 +64,5 @@ await handleFetchConfigMap();
</div>
</div>
</div>
</Transition>
</template>

View File

@ -113,14 +113,12 @@ watch([() => route.name, () => route.params], async () => {
<div class="bg-white">
<RouterView :key="activeTab" v-slot="{ Component }">
<template v-if="Component">
<Transition appear mode="out-in" name="fade">
<Suspense>
<component :is="Component"></component>
<template #fallback>
<VLoading />
</template>
</Suspense>
</Transition>
</template>
</RouterView>
</div>