App.vue
2.08 KB
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
<template>
<div id="app">
<router-view v-if="isRouterAlive" />
<div class="loading" v-show="isShow">
<div class="content">
<i class="fa fa-spinner fa-pulse fa-3x fa-fw" style="color:#0081FF"></i>
<span>{{tips}}</span>
</div>
</div>
</div>
</template>
<script>
export default {
provide(){
return{
reload:this.reload
}
},
data(){
return{
isRouterAlive:true,
isShow:false,
tips:'正在努力加载中...'
}
},
mounted() {
window.addEventListener("unload", this.saveState);
window.vm = this;
},
methods: {
saveState() {
sessionStorage.setItem("state", JSON.stringify(this.$store.state));
},
reload(){
this.isRouterAlive = false;
this.$nextTick(function () {
this.isRouterAlive = true;
})
},
loadingShow(tips){
this.isShow = true;
this.tips = tips+'...';
},
loadingHide(){
this.isShow = false;
}
},
};
</script>
<style lang="less">
#app{
position: relative;
.loading{
width: 100%;
height: 100%;
// background-color: rgba(255, 255, 255, .3);
position: absolute;
top: 0;
left: 0;
z-index: 1000;
.content{
width: 240px;
height: 160px;
background: #FFFFFF;
box-shadow: 0px 4px 28px 0px rgba(0, 0, 0, 0.24);
border-radius: 4px;
border: 1px solid #E6E6E6;
box-sizing: border-box;
padding: 32px;
position: absolute;
top: 50%;
left: 50%;
margin-left: -80px;
margin-top: -120px;
i,span{
display: block;
margin: 0 auto;
text-align: center;
}
span{
margin-top: 26px;
color: #6D7278;
font-size: 14px;
}
}
}
}
.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: #F0F9FF;
}
.cantClick{
color: #BBB!important;
cursor: not-allowed!important;
}
.cantClick:hover{
background: #ffffff!important;
}
.choosed{
i{
display: inline-block;
}
}
}
}
</style>