feat: 添加 IonRouterOutlet 组件支持,优化 App 组件的路由动画设置

This commit is contained in:
2025-12-23 05:50:51 +07:00
parent a87f11c1f4
commit df9c9da25e
3 changed files with 7 additions and 3 deletions

1
auto-imports.d.ts vendored
View File

@@ -7,6 +7,7 @@
export {} export {}
declare global { declare global {
const EffectScope: typeof import('vue').EffectScope const EffectScope: typeof import('vue').EffectScope
const IonRouterOutlet: typeof import('@ionic/vue').IonRouterOutlet
const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate const acceptHMRUpdate: typeof import('pinia').acceptHMRUpdate
const asyncComputed: typeof import('@vueuse/core').asyncComputed const asyncComputed: typeof import('@vueuse/core').asyncComputed
const autoResetRef: typeof import('@vueuse/core').autoResetRef const autoResetRef: typeof import('@vueuse/core').autoResetRef

View File

@@ -6,15 +6,16 @@ const { isAuthenticated } = storeToRefs(userStore);
const { locale, loadSavedLanguage } = useLanguage(); const { locale, loadSavedLanguage } = useLanguage();
const { initializeWallet } = useWalletStore(); const { initializeWallet } = useWalletStore();
const { updateProfile } = useUserStore(); const { updateProfile } = useUserStore();
const route = useRoute();
onMounted(() => { onMounted(() => {
if (!isAuthenticated.value) if (!isAuthenticated.value)
return; return;
updateProfile(); updateProfile();
initializeWallet(); initializeWallet();
CapacitorApp.addListener("appStateChange", async ({ isActive }) => { CapacitorApp.addListener("appStateChange", ({ isActive }) => {
if (isActive) { if (isActive) {
await userStore.updateProfile(); userStore.updateProfile();
} }
}); });
}); });
@@ -31,7 +32,7 @@ watch(locale, (newLocale) => {
<template> <template>
<IonApp> <IonApp>
<Suspense> <Suspense>
<IonRouterOutlet /> <IonRouterOutlet :animated="false" />
</Suspense> </Suspense>
</IonApp> </IonApp>
</template> </template>

View File

@@ -52,6 +52,8 @@ authClient.getSession().then((session) => {
mode: "ios", mode: "ios",
statusTap: true, statusTap: true,
swipeBackEnabled: true, swipeBackEnabled: true,
// rippleEffect: true,
// animated: false,
}) })
.use(uiComponents) .use(uiComponents)
.use(pinia) .use(pinia)