1234567891011121314151617181920212223242526272829303132333435 |
- import { createI18n } from 'vue-i18n'
- import VueI18n from 'vue-i18n'
- import {
- post,
- get
- } from '@/utils/axios'
- const i18n = createI18n({
- legacy: false, // 让 setup 函数可以通过 t 访问
- globalInjection: true, // 让 template 可以像 vue2 那样使用 $t 来访问
- locale: 'zh-cn',
- fallbackLocale: 'zh-cn',
-
- messages: {
- 'zh-cn': require('./cn.js').lang,
- 'en-us': require('./en.js').lang,
- }
- })
- // const networkLang = {
- // web:{},
- // app:{
- // cn:require('./cn.js').lang,
- // en:require('./en.js').lang,
- // },
- // }
- // post('/open/multilingual/setJson', {
- // configValue: JSON.stringify(networkLang),
- // })
- //console.log(require('./en.js').lang)
- //get('/open/multilingual/getJson',{}).then(res=>{
- // console.log(JSON.parse(res.data),'下载')
- // window.localStorage.setItem('lang',res.data)
- // i18n.global.setLocaleMessage('zh-cn', require('./cn.js').lang)
- //})
- export default i18n
|