<template>
	<div id="app">
		<router-view />
	</div>
</template>

<script>
	import {
		mapGetters,
		mapMutations
	} from 'vuex'
	import {
		clear,
	} from '$project/utils/storage'
	import * as types from '$project/store/mutation-types'
	export default {
		name: 'Home',
		created() {
			//更新版本号，清除本地数据
			if (this.app_version != process.env.VUE_APP_VERSION) {
				clear();
				//写入当前版本号
				this.set_app_version(process.env.VUE_APP_VERSION);
			}
		},
		methods: {
			...mapMutations({
				set_app_version: types.SET_APP_VERSION,
			})
		},
		mounted() {
			mui('body').on('tap', '.kfz', function() {
				mui.toast('开发中');
			});
			mui('body').on('tap', '.jump', function() {
				document.location.href = this.href;
			});
		},
		computed: {
			...mapGetters({
				app_version: 'app_version'
			})
		}
	}
</script>

<style lang="scss">
	#app {
		font-family: Avenir, Helvetica, Arial, sans-serif;
		-webkit-font-smoothing: antialiased;
		-moz-osx-font-smoothing: grayscale;
	}

	.kfz,
	.kfz a,
	.kfz span,
	.kfz p,
	.kfz div {
		color: #ddd !important;
	}
</style>
