xincheng.vue 1.26 KB
<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() {
		// if (!window.localStorage.getItem('selectTab')) {
		// 	window.localStorage.setItem('selectTab', 'home')
		// }
		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>