-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtransition.html
60 lines (57 loc) · 1.51 KB
/
transition.html
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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script src="js/vue.js"></script>
<style>
.trshow-enter-active,.trshow-leave-active {
transition: opacity 0.5s;
}
.trshow-enter,.trshow-leave-to {
opacity: 0;
}
.trmove-enter-active,.trmove-leave-active{
transition: all 2s;
}
.trmove-enter,.trmove-leave-to{
opacity: 0;
transform: translateX(200px);
}
.bounce-enter-active {
animation: bounce-in .5s;
}
.bounce-leave-active {
animation: bounce-in .5s reverse;
}
@keyframes bounce-in {
0% {
transform: scale(0);
}
50% {
transform: scale(1.5);
}
100% {
transform: scale(1);
}
}
</style>
</head>
<body>
<div id="root">
<button @click="handelClick">toggle</button>
<transition name='trshow'>
<p v-show='bool'>{{msg}}</p>
</transition>
<button @click='handeltran'>toggle</button>
<transition name='trmove'>
<p v-show='bool'>{{title}}</p>
</transition>
<button @click="handleScale">scale</button><br>
<transition name='bounce'>
<p v-show='bool' style="display: inline-block">{{msg}}</p>
</transition>
</div>
<script src="js/transition.js"></script>
</body>
</html>