<template>
	<div id="app">
		<keep-alive v-if="isRouterAlive">
			<router-view v-if="$route.meta.keepAlive"></router-view>
		</keep-alive>
		<router-view v-if="!$route.meta.keepAlive"></router-view>
	</div>
</template>

<script>
	export default {
		name: 'App',
		data() {
			return {
				isRouterAlive: true
			}
		},
		// computed: {
		// 	key() {
		// 		return this.$route.name !== undefined? this.$route.name + +new Date(): this.$route + +new Date()
		// 	}
		// },
		provide() {
			return {
				reload: this.reload
			};
		},
		methods: {
			reload() {
				this.isRouterAlive = false;
				this.$nextTick(() => (this.isRouterAlive = true));
			}
		}
	}
</script>
