Skip to content

Commit e53b1b5

Browse files
committed
vue动画的使用
1 parent 3b998b8 commit e53b1b5

File tree

3 files changed

+8
-11
lines changed

3 files changed

+8
-11
lines changed

vuejs练习/渐进过渡/index.html

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>vuejs练习</title>
6-
6+
<link rel="stylesheet" type="text/css" href="index.css">
77
</head>
88
<body>
99
<div id="demo">
@@ -18,6 +18,5 @@
1818
</div>
1919
<script src='http://cdn.jsdelivr.net/vue/1.0.26/vue.min.js'></script>
2020
<script src="index.js"></script>
21-
<link type="text/css" href="index.css">
2221
</body>
2322
</html>

vuejs练习/过渡/index.html

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,16 +3,14 @@
33
<head>
44
<meta charset="UTF-8">
55
<title>vuejs练习</title>
6-
6+
<link rel="stylesheet" type="text/css" href="index.css">
77
</head>
88
<body>
99
<div id="repeat-object">
10-
<div v-if="show" transition="bounce">hello</div>
11-
<button v-on:click="testShow">testShow</button>
12-
</br>
10+
<div v-if="show" transition="bounce">hello</div></br>
11+
<button v-on:click="testShow">测试</button>
1312
</div>
14-
<script src='http://cdn.jsdelivr.net/vue/1.0.26/vue.min.js'></script>
13+
<script src='../vue.min.js'></script>
1514
<script src="index.js"></script>
16-
<link type="text/css" href="index.css">
1715
</body>
1816
</html>

vuejs练习/过渡/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ new Vue({
22
el:"#repeat-object",
33
data:{
44
show: true,
5-
transitionName: 'bounce'
5+
//transitionName: 'bounce'//可选
66
},
77
methods:{
88
testShow:function (event) {
9-
this.show = this.show;
9+
this.show = !this.show;
1010
}
1111
}
1212
})
13-
13+
// 这里的名字必须和css和html的名字一致才能都起作用。如果css和js中只有一个名字相同,则名字相同的那个起作用。
1414
Vue.transition('bounce', {
1515

1616
beforeEnter: function (el) {

0 commit comments

Comments
 (0)