You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You also need to define CSS rules for `.expand-enter` and `.expand-leave` classes:
26
+
You also need to define CSS rules for `.expand-transition`, `.expand-enter` and `.expand-leave` classes:
27
27
28
28
```css
29
-
.msg {
29
+
.expand-transition {
30
30
transition: all.3sease;
31
31
height: 30px;
32
32
padding: 10px;
33
33
background-color: #eee;
34
34
overflow: hidden;
35
35
}
36
-
.msg.expand-enter, .msg.expand-leave {
36
+
.expand-enter, .expand-leave {
37
37
height: 0;
38
38
padding: 010px;
39
39
opacity: 0;
40
40
}
41
41
```
42
42
43
-
<divid="demo"><pclass="msg"v-if="show"v-transition="expand">Hello!</p><buttonv-on="click: show = !show">Toggle</button></div>
43
+
<divid="demo"><divv-if="show"v-transition="expand">Hello!</div><buttonv-on="click: show = !show">Toggle</button></div>
44
44
45
45
<style>
46
-
.msg {
47
-
transition: all.5sease;
46
+
.expand-transition {
47
+
transition: all.3sease;
48
48
height: 30px;
49
+
padding: 10px;
49
50
background-color: #eee;
50
51
overflow: hidden;
51
-
padding: 10px;
52
-
margin: 0!important;
53
52
}
54
-
.msg.expand-enter, .msg.expand-leave {
53
+
.expand-enter, .expand-leave {
55
54
height: 0;
56
55
padding: 010px;
57
56
opacity: 0;
@@ -65,7 +64,7 @@ new Vue({
65
64
})
66
65
</script>
67
66
68
-
The classes being toggled are based on the value of your `v-transition` directive. In the case of `v-transition="fade"`, the classes being toggled will be `.fade-enter` and `.fade-leave`. When no value is provided they will default to `.v-enter` and `.v-leave`.
67
+
The classes being added and toggled are based on the value of your `v-transition` directive. In the case of `v-transition="fade"`, the class `.fade-transition`will be always present, and the classes `.fade-enter` and `.fade-leave` will be toggled automatically at the right moments. When no value is provided they will default to`.v-transition`,`.v-enter` and `.v-leave`.
69
68
70
69
When the `show` property changes, Vue.js will insert or remove the `<p>` element accordingly, and apply transition classes as specified below:
71
70
@@ -89,17 +88,14 @@ CSS animations are applied in the same way with CSS transitions, the difference
89
88
**Example:** (omitting prefixed CSS rules here)
90
89
91
90
```html
92
-
<pclass="animated"v-if="show"v-transition="bounce">Look at me!</p>
91
+
<spanv-show="show"v-transition="bounce">Look at me!</span>
93
92
```
94
93
95
94
```css
96
-
.animated {
97
-
display: inline-block;
98
-
}
99
-
.animated.bounce-enter {
95
+
.bounce-enter {
100
96
animation: bounce-in .5s;
101
97
}
102
-
.animated.bounce-leave {
98
+
.bounce-leave {
103
99
animation: bounce-out .5s;
104
100
}
105
101
@keyframesbounce-in {
@@ -126,17 +122,14 @@ CSS animations are applied in the same way with CSS transitions, the difference
126
122
}
127
123
```
128
124
129
-
<divid="anim"class="demo"><spanclass="animated"v-if="show"v-transition="bounce">Look at me!</span><br><buttonv-on="click: show = !show">Toggle</button></div>
125
+
<divid="anim"class="demo"><spanv-show="show"v-transition="bounce">Look at me!</span><br><buttonv-on="click: show = !show">Toggle</button></div>
0 commit comments