app.vue
1.04 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
<template>
<div id="app">
<transition
:name="`route-view-${yoho.direction}`"
@after-enter="$bus.$emit('after-view-enter')">
<router-view></router-view>
</transition>
</div>
</template>
<script>
import {mapState} from 'vuex';
export default {
name: 'App',
computed: {
...mapState(['yoho'])
}
};
</script>
<style lang="scss">
.route-view-forword-enter-active,
.route-view-forword-leave-active,
.route-view-back-enter-active,
.route-view-back-leave-active {
will-change: true;
transition: all 300ms;
width: 100%;
height: 100%;
position: absolute;
backface-visibility: hidden;
perspective: 1000;
}
.route-view-forword-enter {
opacity: 0;
transform: translate3d(100%, 0, 0);
}
.route-view-forword-leave-active {
opacity: 0;
transform: translate3d(-100%, 0, 0);
}
.route-view-back-enter {
opacity: 0;
transform: translate3d(-100%, 0, 0);
}
.route-view-back-leave-active {
opacity: 0;
transform: translate3d(100%, 0, 0);
}
</style>