新增:增加国际化语言支持;

This commit is contained in:
iczer
2020-06-23 14:19:42 +08:00
parent 98bc9b2386
commit 198b1e2ab5
4 changed files with 27 additions and 3 deletions

View File

@@ -22,10 +22,13 @@ export default {
watch: {
weekMode(val) {
this.setWeekModeTheme(val)
},
lang(val) {
this.$i18n.locale = val
}
},
computed: {
...mapState('setting', ['weekMode'])
...mapState('setting', ['weekMode', 'lang'])
},
methods: {
setWeekModeTheme(weekMode) {

View File

@@ -9,20 +9,29 @@ import '@/mock'
import store from './store'
import PouchDB from 'pouchdb'
import 'animate.css/source/animate.css'
import VueI18n from 'vue-i18n'
Vue.prototype.$axios = axios
Vue.config.productionTip = false
Vue.use(Viser)
Vue.use(Antd)
Vue.use(VueI18n)
const i18n = new VueI18n({
locale: 'CN',
fallbackLocale: 'US',
silentFallbackWarn: true
})
new Vue({
router,
store,
i18n,
render: h => h(App),
mounted () {
var db = new PouchDB('admindb')
let db = new PouchDB('adminDb')
db.get('currUser').then(doc => {
this.$store.commit('account/setuser', doc.user)
this.$store.commit('account/setUser', doc.user)
})
},
}).$mount('#app')