mirror of https://github.com/halo-dev/halo-admin
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
parent
26ed1ecf04
commit
5a8b046862
|
@ -55,7 +55,7 @@ const onUpgradeModalClose = () => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Transition appear mode="out-in" name="fade">
|
||||
<Transition mode="out-in" name="fade">
|
||||
<div>
|
||||
<div class="bg-white px-4 py-4 sm:px-6">
|
||||
<div class="group flex items-center justify-between">
|
||||
|
|
|
@ -53,7 +53,7 @@ watch(
|
|||
);
|
||||
</script>
|
||||
<template>
|
||||
<Transition appear mode="out-in" name="fade">
|
||||
<Transition mode="out-in" name="fade">
|
||||
<div class="bg-white p-4">
|
||||
<div>
|
||||
<FormKit
|
||||
|
|
|
@ -59,7 +59,7 @@ watchEffect(() => {
|
|||
</script>
|
||||
|
||||
<template>
|
||||
<Transition appear mode="out-in" name="fade">
|
||||
<Transition mode="out-in" name="fade">
|
||||
<div>
|
||||
<div class="flex items-center justify-between bg-white px-4 py-4 sm:px-6">
|
||||
<div>
|
||||
|
|
|
@ -62,7 +62,7 @@ const handleFetchPlugin = async () => {
|
|||
await handleFetchPlugin();
|
||||
</script>
|
||||
<template>
|
||||
<Transition appear mode="out-in" name="fade">
|
||||
<Transition mode="out-in" name="fade">
|
||||
<div class="bg-white p-4">
|
||||
<div>
|
||||
<FormKit
|
||||
|
|
|
@ -33,36 +33,31 @@ await handleFetchSettings();
|
|||
await handleFetchConfigMap();
|
||||
</script>
|
||||
<template>
|
||||
<Transition appear mode="out-in" name="fade">
|
||||
<div class="bg-white p-4">
|
||||
<div>
|
||||
<FormKit
|
||||
v-if="group && formSchema && configMapFormData"
|
||||
:id="group"
|
||||
v-model="configMapFormData[group]"
|
||||
:name="group"
|
||||
:actions="false"
|
||||
:preserve="true"
|
||||
type="form"
|
||||
@submit="handleSaveConfigMap"
|
||||
<div class="bg-white p-4">
|
||||
<div>
|
||||
<FormKit
|
||||
v-if="group && formSchema && configMapFormData"
|
||||
:id="group"
|
||||
v-model="configMapFormData[group]"
|
||||
:name="group"
|
||||
:actions="false"
|
||||
:preserve="true"
|
||||
type="form"
|
||||
@submit="handleSaveConfigMap"
|
||||
>
|
||||
<FormKitSchema :schema="formSchema" :data="configMapFormData[group]" />
|
||||
</FormKit>
|
||||
</div>
|
||||
<div v-permission="['system:configmaps:manage']" class="pt-5">
|
||||
<div class="flex justify-start">
|
||||
<VButton
|
||||
:loading="saving"
|
||||
type="secondary"
|
||||
@click="$formkit.submit(group || '')"
|
||||
>
|
||||
<FormKitSchema
|
||||
:schema="formSchema"
|
||||
:data="configMapFormData[group]"
|
||||
/>
|
||||
</FormKit>
|
||||
</div>
|
||||
<div v-permission="['system:configmaps:manage']" class="pt-5">
|
||||
<div class="flex justify-start">
|
||||
<VButton
|
||||
:loading="saving"
|
||||
type="secondary"
|
||||
@click="$formkit.submit(group || '')"
|
||||
>
|
||||
保存
|
||||
</VButton>
|
||||
</div>
|
||||
保存
|
||||
</VButton>
|
||||
</div>
|
||||
</div>
|
||||
</Transition>
|
||||
</div>
|
||||
</template>
|
||||
|
|
|
@ -113,12 +113,14 @@ watch([() => route.name, () => route.params], async () => {
|
|||
<div class="bg-white">
|
||||
<RouterView :key="activeTab" v-slot="{ Component }">
|
||||
<template v-if="Component">
|
||||
<Suspense>
|
||||
<component :is="Component"></component>
|
||||
<template #fallback>
|
||||
<VLoading />
|
||||
</template>
|
||||
</Suspense>
|
||||
<Transition appear mode="out-in" name="fade">
|
||||
<Suspense>
|
||||
<component :is="Component"></component>
|
||||
<template #fallback>
|
||||
<VLoading />
|
||||
</template>
|
||||
</Suspense>
|
||||
</Transition>
|
||||
</template>
|
||||
</RouterView>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue