App.vue
1003 Bytes
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
60
61
62
63
64
65
66
67
68
<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: 4px 16px;
			position: relative;
			i{
				position: absolute;
				right: 20px;
				top: 6px;
				color: #4EB2FF;
				display: none;
			}
		}
		li:hover{
			background: #eee;
		}
		.choosed{
			color: #4EB2FF;
			background-color: #F0F9FF!important;
			i{
				display: inline-block;
			}
		}
	}
}
</style>