|
1
2
3
4
|
<template>
<global-layout>
<transition name="page-transition">
<keep-alive v-if="keepAlive">
|
|
5
|
<router-view/>
|
|
6
|
</keep-alive>
|
|
7
|
<router-view v-else/>
|
|
8
9
10
11
12
|
</transition>
</global-layout>
</template>
<script>
|
|
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
|
import GlobalLayout from '@/components/page/GlobalLayout'
export default {
name: "BasicLayout",
components: {
GlobalLayout
},
data() {
return {}
},
computed: {
keepAlive() {
return this.$route.meta.keepAlive
}
},
methods: {},
}
|
|
30
31
32
33
|
</script>
<style lang="less">
|
|
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
|
/*
* The following styles are auto-applied to elements with
* transition="page-transition" when their visibility is toggled
* by Vue.js.
*
* You can easily play with the page transition by editing
* these styles.
*/
.page-transition-enter {
opacity: 0;
}
.page-transition-leave-active {
opacity: 0;
}
.page-transition-enter .page-transition-container,
.page-transition-leave-active .page-transition-container {
-webkit-transform: scale(1.1);
transform: scale(1.1);
}
|
|
56
|
</style>
|