perf: optimize the issue of animation when switching setting tabs (#748)

#### What type of PR is this?

/kind improvement

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

优化主题和插件详情页面切换 tab 时的页面闪动问题。

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

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

#### Special notes for your reviewer:

测试方式:检查在主题和插件详情页面是否还存在 https://github.com/halo-dev/halo/issues/2856 中提到的问题。

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

```release-note
优化 Console 端的主题和插件详情页面切换选项卡时的页面闪动问题。
```
pull/758/head
Ryan Wang 2022-12-07 12:26:54 +08:00 committed by GitHub
parent 26ed1ecf04
commit 5a8b046862
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 36 additions and 39 deletions

View File

@ -55,7 +55,7 @@ const onUpgradeModalClose = () => {
</script> </script>
<template> <template>
<Transition appear mode="out-in" name="fade"> <Transition mode="out-in" name="fade">
<div> <div>
<div class="bg-white px-4 py-4 sm:px-6"> <div class="bg-white px-4 py-4 sm:px-6">
<div class="group flex items-center justify-between"> <div class="group flex items-center justify-between">

View File

@ -53,7 +53,7 @@ watch(
); );
</script> </script>
<template> <template>
<Transition appear mode="out-in" name="fade"> <Transition mode="out-in" name="fade">
<div class="bg-white p-4"> <div class="bg-white p-4">
<div> <div>
<FormKit <FormKit

View File

@ -59,7 +59,7 @@ watchEffect(() => {
</script> </script>
<template> <template>
<Transition appear mode="out-in" name="fade"> <Transition mode="out-in" name="fade">
<div> <div>
<div class="flex items-center justify-between bg-white px-4 py-4 sm:px-6"> <div class="flex items-center justify-between bg-white px-4 py-4 sm:px-6">
<div> <div>

View File

@ -62,7 +62,7 @@ const handleFetchPlugin = async () => {
await handleFetchPlugin(); await handleFetchPlugin();
</script> </script>
<template> <template>
<Transition appear mode="out-in" name="fade"> <Transition mode="out-in" name="fade">
<div class="bg-white p-4"> <div class="bg-white p-4">
<div> <div>
<FormKit <FormKit

View File

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

View File

@ -113,12 +113,14 @@ 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>