App.vue 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. <template>
  2. <ConfigProvider :locale="antdLocal">
  3. <AppProvider>
  4. <RouterView />
  5. </AppProvider>
  6. </ConfigProvider>
  7. </template>
  8. <script lang="ts" setup>
  9. import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN';
  10. import en from 'ant-design-vue/lib/locale-provider/en_US';
  11. import zhTW from 'ant-design-vue/lib/locale-provider/zh_TW';
  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 'dayjs/locale/zh-cn';
  17. import { computed } from 'vue';
  18. // support Multi-language
  19. const { getLocale } = useLocale();
  20. const antdLocal = computed(() => {
  21. if (getLocale.value === 'zh_CN') {
  22. return zhCN;
  23. }
  24. if (getLocale.value === 'en') {
  25. return en;
  26. }
  27. if (getLocale.value === 'zh_TW') {
  28. return zhTW;
  29. }
  30. return zhCN;
  31. });
  32. // Listening to page changes and dynamically changing site titles
  33. useTitle();
  34. </script>
  35. <style lang="less" scoped>
  36. :deep(.ant-tree-treenode),
  37. :deep(.ant-tree-node-content-wrapper) {
  38. width: 100%;
  39. height: 35px;
  40. line-height: 35px;
  41. }
  42. :deep(.ant-tree .ant-tree-node-content-wrapper) {
  43. height: 35px;
  44. line-height: 35px;
  45. }
  46. </style>