App.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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(1920);
  28. const height = ref(929);
  29. const body = document.body.getBoundingClientRect();
  30. if (screen.height === body.height && screen.width === body.width) {
  31. height.value = 1080;
  32. }
  33. useTitle();
  34. </script>
  35. <style lang="less" scoped>
  36. #app {
  37. overflow: hidden;
  38. }
  39. @font-face {
  40. font-family: 'douyuFont';
  41. src: url('/@/assets/font/douyuFont.otf');
  42. font-weight: normal;
  43. font-style: normal;
  44. }
  45. </style>