App.vue 841 B

123456789101112131415161718192021222324252627282930
  1. <template>
  2. <div id="app">
  3. <a-config-provider :locale="locale" :theme="themeConfig">
  4. <router-view />
  5. </a-config-provider>
  6. </div>
  7. </template>
  8. <script setup>
  9. import { ref } from 'vue'
  10. import zhCN from 'ant-design-vue/es/locale/zh_CN'
  11. import themeColors from '@/styles/theme.module.less'
  12. // 设置中文语言
  13. const locale = ref(zhCN)
  14. // Ant Design Vue 4 使用运行时主题,与业务 Less 共用主色。
  15. const themeConfig = { token: { colorPrimary: themeColors.primaryColor } }
  16. </script>
  17. <style lang="less">
  18. :root {
  19. --meow-color-primary: @primary-color;
  20. --meow-color-primary-active: @primary-active-color;
  21. --meow-color-primary-light: @primary-light-color;
  22. }
  23. body {
  24. font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  25. background-color: #fafafa;
  26. }
  27. </style>