index.vue 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <!--
  2. * @Author: xvying 1615026511@qq.com
  3. * @Date: 2022-10-31 14:56:49
  4. * @LastEditors: xvying 1615026511@qq.com
  5. * @LastEditTime: 2022-11-30 13:44:28
  6. * @FilePath: /xinjincheng-pc/library/components/VabApp/index.vue
  7. * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
  8. -->
  9. <!-- <script lang="ts" setup>
  10. import { pwa } from '@/config'
  11. import { enLocale, zhLocale } from '@/i18n/index'
  12. const { locale: language } = useI18n()
  13. const locale = computed(() => (language.value === 'en' ? enLocale : zhLocale))
  14. const VabUpdate = defineAsyncComponent(
  15. () => import('@/plugins/VabUpdate/index.vue')
  16. )
  17. </script> -->
  18. <script>
  19. import { pwa } from '@/config'
  20. // import { zhCn } from '@/i18n/index'
  21. // const { locale: language } = useI18n()
  22. // const locale = computed(() => (language.value === 'en' ? zhCn : zhCn))
  23. import { defineComponent } from 'vue'
  24. import { ElConfigProvider } from 'element-plus'
  25. import zhCn from 'element-plus/dist/locale/zh-cn.mjs'
  26. import VabUpdate from '@/plugins/VabUpdate/index.vue'
  27. export default defineComponent({
  28. components: {
  29. ElConfigProvider,
  30. VabUpdate,
  31. },
  32. setup() {
  33. return {
  34. locale: zhCn,
  35. }
  36. },
  37. })
  38. </script>
  39. <template>
  40. <el-config-provider
  41. :button="{
  42. autoInsertSpace: true,
  43. }"
  44. :locale="locale"
  45. >
  46. <router-view v-slot="{ Component }">
  47. <component :is="Component" />
  48. </router-view>
  49. <vab-update v-if="pwa" ref="vabUpdateRef" />
  50. </el-config-provider>
  51. </template>