fix: system settings form could not be loaded (halo-dev/console#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/3445/head
Ryan Wang 2022-12-20 19:44:29 +08:00 committed by GitHub
parent 654c22081d
commit 4b3406237c
2 changed files with 35 additions and 32 deletions

View File

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

View File

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