App.vue 1004 Bytes
<template>
	<div id="app">
		<router-view v-if="isRouterAlive" />
	</div>
</template>

<script>
export default {
	provide(){
		return{
			reload:this.reload
		}
	},
	data(){
		return{
			isRouterAlive:true,
		}
	},
	mounted() {
		window.addEventListener("unload", this.saveState);
	},
	methods: {
		saveState() {
			sessionStorage.setItem("state", JSON.stringify(this.$store.state));
		},
		reload(){
			this.isRouterAlive = false;
			this.$nextTick(function () {
				this.isRouterAlive = true;
			})
		},
	},
};
</script>

<style lang="less">
.popper-zxx{
	padding: 0!important;
	/deep/ .el-tabs__header{
		margin-bottom: 10px;
	}
	ul{
		margin-bottom: 10px;
		li{
			cursor: pointer;
			padding: 8px 16px;
			position: relative;
			i{
				position: absolute;
				right: 20px;
				top: 11px;
				color: #4EB2FF;
				display: none;
			}
		}
		li:hover{
			background: #eee;
		}
		.choosed{
			color: #4EB2FF;
			background-color: #F0F9FF!important;
			i{
				display: inline-block;
			}
		}
	}
}
</style>