perf(projects): move changing document title by locale to global event of composables & add appLoading unmount

This commit is contained in:
Soybean
2023-05-31 01:44:18 +08:00
parent 5f6caab338
commit 08e194efe9
3 changed files with 22 additions and 12 deletions

View File

@@ -13,26 +13,14 @@
</template>
<script setup lang="ts">
import { watch } from 'vue';
import { useRoute } from 'vue-router';
import { dateZhCN, zhCN } from 'naive-ui';
import { useI18n } from 'vue-i18n';
import { subscribeStore, useThemeStore } from '@/store';
import { useGlobalEvents } from '@/composables';
const theme = useThemeStore();
const { locale, t } = useI18n();
const route = useRoute();
subscribeStore();
useGlobalEvents();
watch(
() => locale.value,
() => {
document.title = route.meta.i18nTitle ? t(route.meta.i18nTitle) : route.meta.title;
}
);
</script>
<style scoped></style>