xincheng.vue
1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<template>
<div id="xincheng" style="width:100%;height:100%">
<router-view v-if="isRouterAlive"></router-view>
</div>
</template>
<script>
export default {
name: 'xincheng',
data() {
return {
isRouterAlive: true
}
},
provide() {
return {
reload: this.reload
}
},
methods: {
reload() {
this.isRouterAlive = false;
this.$nextTick(() => {
this.isRouterAlive = true;
})
}
},
created() {
let webV = localStorage.getItem('webVersion');
if(webV && webV !== 'undefined') {
if(window._vionConfig.webVersion != webV){
localStorage.setItem('webVersion', window._vionConfig.webVersion);
this.removeStorge();
this.$router.push('/');
} else {
}
}else {
if(window._vionConfig.webVersion) {
localStorage.setItem('webVersion', window._vionConfig.webVersion);
}
}
},
mounted() {
if(this.$Project === 'store') {
let _lang = localStorage.getItem('lang') || 'zh_CN';
_lang = _lang == 'mall_CN' ? 'zh_CN' : _lang;
localStorage.setItem('lang', _lang)
}else{
let _lang = 'mall_CN';
localStorage.setItem('lang', _lang)
}
}
}
</script>
<style>
</style>