Browse Source

[release-2.0] perf: optimize the issue of animation when switching setting tabs (#754)

This is an automated cherry-pick of #748

/assign JohnNiang

```release-note
优化 Console 端的主题和插件详情页面切换选项卡时的页面闪动问题。
```
pull/757/head
Halo Dev Bot 2 years ago committed by GitHub
parent
commit
5a7035be48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/modules/interface/themes/ThemeDetail.vue
  2. 2
      src/modules/interface/themes/ThemeSetting.vue
  3. 2
      src/modules/system/plugins/PluginDetail.vue
  4. 2
      src/modules/system/plugins/PluginSetting.vue
  5. 53
      src/modules/system/settings/SystemSetting.vue
  6. 14
      src/modules/system/settings/layouts/SystemSettingsLayout.vue

2
src/modules/interface/themes/ThemeDetail.vue

@ -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">

2
src/modules/interface/themes/ThemeSetting.vue

@ -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

2
src/modules/system/plugins/PluginDetail.vue

@ -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>

2
src/modules/system/plugins/PluginSetting.vue

@ -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

53
src/modules/system/settings/SystemSetting.vue

@ -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>

14
src/modules/system/settings/layouts/SystemSettingsLayout.vue

@ -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…
Cancel
Save