cloud-web-corejs 1.0.54-dev.442 → 1.0.54-dev.443

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cloud-web-corejs",
3
3
  "private": false,
4
- "version": "1.0.54-dev.442",
4
+ "version": "1.0.54-dev.443",
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
7
7
  "lint": "eslint --ext .js,.vue src",
@@ -15,7 +15,7 @@ function getUrlParams(url) {
15
15
  export default {
16
16
  name: 'Login',
17
17
  props:{
18
- lang: String
18
+ lang: [String,Function]
19
19
  },
20
20
  components: {},
21
21
  data() {
@@ -102,10 +102,17 @@ export default {
102
102
  },
103
103
  methods: {
104
104
  initLang(){
105
- let flag = this.$route.query.lang || this.lang;
106
- if(flag){
107
- this.$i18n.locale = flag;
108
- localStorage.setItem("i18n-lang", flag);
105
+ let lang = this.$route.query.lang || this.lang;
106
+ if(!lang && !!this.lang){
107
+ if(typeof this.lang === "function"){
108
+ lang = this.lang();
109
+ }else{
110
+ lang = this.lang;
111
+ }
112
+ }
113
+ if(lang){
114
+ this.$i18n.locale = lang;
115
+ localStorage.setItem("i18n-lang", lang);
109
116
  }
110
117
  },
111
118
  init() {