feat: save lang to localStorage

This commit is contained in:
qier222 2020-10-22 18:13:48 +08:00
parent 91fac552e0
commit 281f9fe0bc
5 changed files with 67 additions and 50 deletions

View file

@ -1,5 +1,6 @@
import Vue from "vue";
import VueI18n from "vue-i18n";
import store from "@/store";
import en from "./lang/en.js";
import zhCN from "./lang/zh-CN.js";
@ -7,7 +8,7 @@ import zhCN from "./lang/zh-CN.js";
Vue.use(VueI18n);
const i18n = new VueI18n({
locale: "en",
locale: store.state.settings.lang,
messages: {
en,
"zh-CN": zhCN