admin-vben/src/App.vue

32 lines
917 B
Vue
Raw Normal View History

2023-03-18 13:10:54 +00:00
<script lang="ts" setup>
2023-07-30 02:06:13 +00:00
import 'dayjs/locale/zh-cn'
2023-08-22 11:01:14 +00:00
import { App, ConfigProvider } from 'ant-design-vue'
2023-07-30 02:06:13 +00:00
import { storeToRefs } from 'pinia'
2023-08-12 09:04:48 +00:00
import { computed } from 'vue'
2023-03-18 13:10:54 +00:00
import { AppProvider } from '@/components/Application'
import { useTitle } from '@/hooks/web/useTitle'
import { useLocale } from '@/locales/useLocale'
import { useAppStore } from '@/store/modules/app'
// support Multi-language
const { getAntdLocale } = useLocale()
const appStore = useAppStore()
2023-07-30 02:06:13 +00:00
const { themeConfig } = storeToRefs(appStore)
2023-08-12 09:04:48 +00:00
const componentSize = computed(() => appStore.getComponentSize)
2023-03-18 13:10:54 +00:00
// Listening to page changes and dynamically changing site titles
useTitle()
</script>
2023-07-29 10:46:43 +00:00
<template>
2023-08-12 09:04:48 +00:00
<ConfigProvider :locale="getAntdLocale" :theme="themeConfig" :component-size="componentSize">
2023-08-22 11:01:14 +00:00
<App class="h-full w-full">
<AppProvider>
<RouterView />
</AppProvider>
</App>
2023-07-29 10:46:43 +00:00
</ConfigProvider>
</template>