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
| <template>
| <div class="rootDiv" :class="['root_node', $store.state.theme.index > -1 ? 'theme_' + $store.state.theme.index : '']">
| <router-view></router-view>
| <div v-show="maskShow" ref="mask" class="trans_mask"></div>
| </div>
| </template>
|
| <script>
|
| export default {
| name: 'App',
| data () {
| return {
| maskShow: false
| }
| },
| methods: {
|
| },
| mounted () {
| this.$router.beforeEach((to, from, next) => {
| this.maskShow = true;
| next();
| });
| this.$router.afterEach((to, from) => {
| setTimeout(() => {
| this.maskShow = false;
| }, 0);
| });
| }
| }
| </script>
|
| <style>
| .trans_mask {
| background-color: transparent;
| position: fixed;
| left: 0;
| right: 0;
| top: 0;
| bottom: 0;
| z-index: 9999;
| }
| </style>
|
|