feat(app): 优化页面切换动画并添加登录页缓存

- 在 App.vue 中添加路由中间件,控制页面切换动画方向
- 在 login 页面添加 keepalive 属性,提高性能和用户体验
This commit is contained in:
xingyy 2025-03-03 11:48:19 +08:00
parent 23a127b0d3
commit fb213caf28
2 changed files with 3 additions and 3 deletions

View File

@ -11,7 +11,7 @@ useHead({
],
})
const route = useRoute()
//
const router = useRouter()
const slideDirection = ref('slide-left')
@ -37,7 +37,6 @@ if (to.path==='/'){
//
provide('slideDirection', slideDirection)
</script>
<template>
@ -50,7 +49,7 @@ provide('slideDirection', slideDirection)
<NuxtLayout>
<NuxtPage :transition="{
name: slideDirection
}"/>
}" keepalive />
</NuxtLayout>
</VanConfigProvider>
</client-only>

View File

@ -11,6 +11,7 @@ const router = useRouter();
const route = useRoute();
const { locale } = useI18n()
definePageMeta({
keepalive: true,
i18n: 'login.title'
})
const loadingRef=ref({