Skip to content

Commit 1621bc9

Browse files
committed
add vue2.0 transtion demo
1 parent 33fa5fa commit 1621bc9

File tree

2 files changed

+7585
-0
lines changed

2 files changed

+7585
-0
lines changed

vue-transition/vue2.0-transition.html

+70
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Strive——http://www.itstrive.com</title>
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
7+
<meta name="apple-mobile-web-app-capable" content="yes">
8+
<meta name="apple-mobile-web-app-status-bar-style" content="black">
9+
<style>
10+
html,body{
11+
height:100%;
12+
overflow: hidden;
13+
}
14+
</style>
15+
<script src="vue2.0.js"></script><!--需要引入2.0的库文件-->
16+
<link rel="stylesheet" href="animate.css">
17+
<script>
18+
window.onload=function(){
19+
new Vue({
20+
el:'#box',
21+
data:{
22+
show:true
23+
}
24+
});
25+
};
26+
</script>
27+
</head>
28+
<body>
29+
<div id="box">
30+
<input type="button" value="切换" @click=" show=!show">
31+
32+
<transition enter-active-class="zoomInLeft" leave-active-class="zoomOutRight">
33+
<p v-show="show" class="animated">我是一个段落元素</p>
34+
</transition>
35+
36+
<transition-group enter-active-class="bounceInLeft" leave-active-class="bounceOutRight">
37+
<p v-show="show" class="animated" :key="1">我是一个段落元素</p>
38+
<div v-if="show" class="animated" :style="{
39+
width:'100px',
40+
height:'100px',
41+
background:'red'
42+
}" :key="2"></div>
43+
</transition-group>
44+
45+
<!--
46+
enter-active-class 就是动画进入的class, zoomInLeft这个class在animate.css里面有定义
47+
同理: leave-active-class一样
48+
-->
49+
</div>
50+
</body>
51+
</html>
52+
53+
54+
55+
56+
57+
58+
59+
60+
61+
62+
63+
64+
65+
66+
67+
68+
69+
70+

0 commit comments

Comments
 (0)