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
* fix: remove references to old versions of Vue 2
* fix: comment out TODOs
* fix: update references to v-enter and v-leave
* fix: update an example to match the CodePen
* fix: correct typos
* fix: introduce some articles to improve the flow
* fix: migrate an example to Vue 3
Copy file name to clipboardExpand all lines: src/guide/transitions-enterleave.md
+32-28Lines changed: 32 additions & 28 deletions
Original file line number
Diff line number
Diff line change
@@ -75,17 +75,17 @@ When an element wrapped in a `transition` component is inserted or removed, this
75
75
76
76
There are six classes applied for enter/leave transitions.
77
77
78
-
1.`v-enter-from`: Starting state for enter. Added before element is inserted, removed one frame after element is inserted.
78
+
1.`v-enter-from`: Starting state for enter. Added before the element is inserted, removed one frame after the element is inserted.
79
79
80
-
2.`v-enter-active`: Active state for enter. Applied during the entire entering phase. Added before element is inserted, removed when transition/animation finishes. This class can be used to define the duration, delay and easing curve for the entering transition.
80
+
2.`v-enter-active`: Active state for enter. Applied during the entire entering phase. Added before the element is inserted, removed when the transition/animation finishes. This class can be used to define the duration, delay and easing curve for the entering transition.
81
81
82
-
3.`v-enter-to`: **Only available in versions 2.1.8+.**Ending state for enter. Added one frame after element is inserted (at the same time `v-enter` is removed), removed when transition/animation finishes.
82
+
3.`v-enter-to`: Ending state for enter. Added one frame after the element is inserted (at the same time `v-enter-from` is removed), removed when the transition/animation finishes.
83
83
84
84
4.`v-leave-from`: Starting state for leave. Added immediately when a leaving transition is triggered, removed after one frame.
85
85
86
-
5.`v-leave-active`: Active state for leave. Applied during the entire leaving phase. Added immediately when leave transition is triggered, removed when the transition/animation finishes. This class can be used to define the duration, delay and easing curve for the leaving transition.
86
+
5.`v-leave-active`: Active state for leave. Applied during the entire leaving phase. Added immediately when a leave transition is triggered, removed when the transition/animation finishes. This class can be used to define the duration, delay and easing curve for the leaving transition.
87
87
88
-
6.`v-leave-to`: **Only available in versions 2.1.8+.**Ending state for leave. Added one frame after a leaving transition is triggered (at the same time `v-leave` is removed), removed when the transition/animation finishes.
88
+
6.`v-leave-to`: Ending state for leave. Added one frame after a leaving transition is triggered (at the same time `v-leave-from` is removed), removed when the transition/animation finishes.
89
89
90
90

91
91
@@ -153,7 +153,7 @@ CSS animations are applied in the same way as CSS transitions, the difference be
153
153
Here's an example, omitting prefixed CSS rules for the sake of brevity:
@@ -210,10 +210,10 @@ You can also specify custom transition classes by providing the following attrib
210
210
211
211
-`enter-from-class`
212
212
-`enter-active-class`
213
-
-`enter-to-class` (2.1.8+)
213
+
-`enter-to-class`
214
214
-`leave-from-class`
215
215
-`leave-active-class`
216
-
-`leave-to-class` (2.1.8+)
216
+
-`leave-to-class`
217
217
218
218
These will override the conventional class names. This is especially useful when you want to combine Vue's transition system with an existing CSS animation library, such as [Animate.css](https://daneden.github.io/animate.css/).
219
219
@@ -261,9 +261,7 @@ However, in some cases you may want to have both on the same element, for exampl
261
261
262
262
### Explicit Transition Durations
263
263
264
-
TODO: validate and provide an example
265
-
266
-
> New in 2.2.0+
264
+
<!-- TODO: validate and provide an example -->
267
265
268
266
In most cases, Vue can automatically figure out when the transition has finished. By default, Vue waits for the first `transitionend` or `animationend` event on the root transition element. However, this may not always be desired - for example, we may have a choreographed transition sequence where some nested inner elements have a delayed transition or a longer transition duration than the root transition element.
269
267
@@ -347,7 +345,7 @@ methods: {
347
345
348
346
These hooks can be used in combination with CSS transitions/animations or on their own.
349
347
350
-
When using JavaScript-only transitions, **the `done` callbacks are required for the `enter` and `leave` hooks**. Otherwise, the hooks will be called synchronously and the transition will finish immediately. Adding `:css="false"` will also let know Vue to skip CSS detection. Aside from being slightly more performant, this also prevents CSS rules from accidentally interfering with the transition.
348
+
When using JavaScript-only transitions, **the `done` callbacks are required for the `enter` and `leave` hooks**. Otherwise, the hooks will be called synchronously and the transition will finish immediately. Adding `:css="false"` will also let Vue know to skip CSS detection. Aside from being slightly more performant, this also prevents CSS rules from accidentally interfering with the transition.
351
349
352
350
Now let's dive into an example. Here's a JavaScript transition using [GreenSock](https://greensock.com/):
353
351
@@ -450,7 +448,7 @@ We discuss [transitioning between components](#transitioning-between-components)
450
448
451
449
It's actually possible to transition between any number of elements, either by using multiple `v-if`s or binding a single element to a dynamic property. For example:
452
450
453
-
TODO: rewrite example and put in codepen example
451
+
<!--TODO: rewrite example and put in codepen example-->
454
452
455
453
```html
456
454
<transition>
@@ -537,7 +535,7 @@ Now let's update the transition for our on/off buttons with `out-in`:
537
535
538
536
With one attribute addition, we've fixed that original transition without having to add any special styling.
539
537
540
-
We can use this to coordinate more expressive movement, such as a folding card, as demonstrated below. It's actually two elements transitioning between eachother, but since the beginning and end states are scaling the same: horizontally to 0, it appears like one fluid movement. This type of slight-of-hand can be very useful for realistic UI microinteractions:
538
+
We can use this to coordinate more expressive movement, such as a folding card, as demonstrated below. It's actually two elements transitioning between each other, but since the beginning and end states are scaling the same: horizontally to 0, it appears like one fluid movement. This type of sleight-of-hand can be very useful for realistic UI microinteractions:
<span>See the Pen <ahref="https://codepen.io/team/Vue/pen/76e344bf057bd58b5936bba260b787a8">
@@ -550,19 +548,22 @@ We can use this to coordinate more expressive movement, such as a folding card,
550
548
551
549
Transitioning between components is even simpler - we don't even need the `key` attribute. Instead, we wrap a [dynamic component](component-basics.html#dynamic-components):
0 commit comments