[lazy load lang] load the language file on create

This commit is contained in:
Louis Lam 2021-11-29 16:45:52 +08:00
parent 50593f3edf
commit c50b2b636a

View File

@ -9,6 +9,12 @@ export default {
}; };
}, },
async created() {
if (this.language !== "en") {
await this.changeLang(this.language);
}
},
watch: { watch: {
async language(lang) { async language(lang) {
await this.changeLang(lang); await this.changeLang(lang);