From ee59b3be8b409d2626fd2a8b76b09bc7a018469f Mon Sep 17 00:00:00 2001 From: zlyx <1242874891@qq.com> Date: 星期一, 03 四月 2023 11:48:39 +0800 Subject: [PATCH] update 更新 vite.config.ts 预编译内容 (thanks: 基哥) ; --- src/layout/components/AppMain.vue | 38 +++++++++++++++++++++++++++++--------- 1 files changed, 29 insertions(+), 9 deletions(-) diff --git a/src/layout/components/AppMain.vue b/src/layout/components/AppMain.vue index 5b51fcf..5649fac 100644 --- a/src/layout/components/AppMain.vue +++ b/src/layout/components/AppMain.vue @@ -1,9 +1,9 @@ <template> <section class="app-main"> <router-view v-slot="{ Component, route }"> - <transition name="fade-transform" mode="out-in"> + <transition :enter-active-class="animante" mode="out-in"> <keep-alive :include="tagsViewStore.cachedViews"> - <component v-if="!route.meta.link" :is="Component" :key="route.path"/> + <component v-if="!route.meta.link" :is="Component" :key="route.path" /> </keep-alive> </transition> </router-view> @@ -11,11 +11,31 @@ </section> </template> -<script setup> -import iframeToggle from "./IframeToggle/index" -import useTagsViewStore from '@/store/modules/tagsView' +<script lang="ts"> +export default { + name: 'AppMin' +} +</script> -const tagsViewStore = useTagsViewStore() +<script setup lang="ts"> +import useTagsViewStore from '@/store/modules/tagsView'; +import useSettingsStore from '@/store/modules/settings'; +import IframeToggle from './IframeToggle/index.vue' +import { ComponentInternalInstance } from "vue"; +const { proxy } = getCurrentInstance() as ComponentInternalInstance; +const tagsViewStore = useTagsViewStore(); + +// 闅忔満鍔ㄧ敾闆嗗悎 +const animante = ref<string>(''); +const animationEnable = ref(useSettingsStore().animationEnable); +watch(()=> useSettingsStore().animationEnable, (val) => { + animationEnable.value = val; + if (val) { + animante.value = proxy?.animate.animateList[Math.round(Math.random() * proxy?.animate.animateList.length)] as string; + } else { + animante.value = proxy?.animate.defaultAnimate as string; + } +}, { immediate: true }); </script> <style lang="scss" scoped> @@ -27,7 +47,7 @@ overflow: hidden; } -.fixed-header + .app-main { +.fixed-header+.app-main { padding-top: 50px; } @@ -37,7 +57,7 @@ min-height: calc(100vh - 84px); } - .fixed-header + .app-main { + .fixed-header+.app-main { padding-top: 84px; } } @@ -50,4 +70,4 @@ padding-right: 17px; } } -</style> \ No newline at end of file +</style> -- Gitblit v1.9.3