-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimation.html
61 lines (61 loc) · 1.35 KB
/
animation.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
61
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<script src="https://cdn.staticfile.org/vue/2.2.2/vue.min.js"></script>
<link href="https://cdn.jsdelivr.net/npm/[email protected]" rel="stylesheet" type="text/css" />
<title>动画实例</title>
<style>
.fade-enter-active,.fade-leave-active{
transition: opacity 2s
}
.fade-enter,.fade-leave-to{
opacity: 0
}
.test-enter-active{
animation:test-in .5s;
}
.test-leave-active{
animation: test-in .5s reverse;
}
@keyframes test-in{
0%{
transform: scale(0);
}
50%{
transform: scale(1.5);
}
100%{
transform: scale(1);
}
}
</style>
</head>
<body>
<div id="app">
<input type="button" v-on:click="show=!show" value="点击" />
<transition name=" fade">
<p v-show="show" v-bind:style="styleobj">{{message}}</p>
</transition>
<transition name="test">
<p v-show="show">菜鸟教程 -- 学的不仅是技术,更是梦想!!!</p>
</transition>
<transition name="test1" enter-active-class="animated tada" leave-active-class="animated bounceOutRight">
<p v-show="show">测试1-测试2-测试3</p>
</transition>
</div>
</body>
<script>
new Vue({
el: "#app",
data: {
message: "动画实例",
show: true,
styleobj: {
color: 'red',
fontsize: '30px'
}
}
})
</script>
</html>