App.vue 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <template>
  2. <AdaptiveContainer :options="{ width: width, height: height }" style="overflow-y: hidden">
  3. <ConfigProvider :locale="getAntdLocale">
  4. <AppProvider>
  5. <RouterView />
  6. </AppProvider>
  7. </ConfigProvider>
  8. </AdaptiveContainer>
  9. </template>
  10. <script lang="ts" setup>
  11. import { ref } from 'vue';
  12. import { ConfigProvider } from 'ant-design-vue';
  13. import { AppProvider } from '/@/components/Application';
  14. import { useTitle } from '/@/hooks/web/useTitle';
  15. import { useLocale } from '/@/locales/useLocale';
  16. import AdaptiveContainer from '/@/components/Container/src/Adaptive.vue';
  17. // 解决日期时间国际化问题
  18. import 'dayjs/locale/zh-cn';
  19. ConfigProvider.config({
  20. prefixCls: 'vent-base',
  21. theme: {
  22. primaryColor: '#1890ff',
  23. },
  24. });
  25. // support Multi-language
  26. const { getAntdLocale } = useLocale();
  27. const width = ref(document.body.clientWidth);
  28. const height = ref(document.body.clientHeight);
  29. useTitle();
  30. </script>
  31. <style lang="less" scoped>
  32. #app {
  33. overflow: hidden;
  34. }
  35. @font-face {
  36. font-family: 'douyuFont';
  37. src: url('/@/assets/font/douyuFont.otf');
  38. font-weight: normal;
  39. font-style: normal;
  40. }
  41. </style>