index.js 717 B

123456789101112131415161718192021222324252627282930313233343536
  1. //语言
  2. import { lang } from '@/settings/designSetting'
  3. import { createI18n } from 'vue-i18n' //引入vue-i18n组件
  4. import { useLangStore } from '@/store/modules/langStore'
  5. import zh from './zh/index'
  6. import en from './en/index'
  7. import th from './th/index'
  8. const langStore = useLangStore()
  9. export const i18n = createI18n({
  10. globalInjection: true,
  11. locale: (langStore ?.lang) || lang,
  12. messages: {
  13. 'zh-CN': zh,
  14. 'en-US': en,
  15. 'th-TH': th
  16. }
  17. })
  18. // 语言数组
  19. export const langList = [{
  20. label: '简体中文',
  21. key: 'zh-CN'
  22. },
  23. {
  24. label: 'English',
  25. key: 'en-US'
  26. },
  27. {
  28. label: 'แบบไทย',
  29. key: 'th-TH'
  30. }
  31. ]