src/hooks/web/useTitle.ts
@@ -6,6 +6,9 @@ import { REDIRECT_NAME } from '/@/router/constant'; /** * Listening to page changes and dynamically changing site titles */ export function useTitle() { const { title } = useGlobSetting(); const { t } = useI18n(); @@ -17,6 +20,7 @@ () => currentRoute.value.path, () => { const route = unref(currentRoute); if (route.name === REDIRECT_NAME) { return; } @@ -24,6 +28,6 @@ const tTitle = t(route?.meta?.title as string); pageTitle.value = tTitle ? ` ${tTitle} - ${title} ` : `${title}`; }, { immediate: true } { immediate: true }, ); }