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
Copy file name to clipboardExpand all lines: src/v2/guide/transitions.md
+32-32Lines changed: 32 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -478,24 +478,24 @@ methods: {
478
478
}
479
479
```
480
480
481
-
These hooks can be used in combination with CSS transitions/animations or on their own.
481
+
Ces hooks peuvent être utilisés en combinaison avec des transitions/animations CSS ou sur eux-mêmes.
482
482
483
-
<pclass="tip">When using JavaScript-only transitions, **the `done` callbacks are required for the `enter` and `leave` hooks**. Otherwise, they will be called synchronously and the transition will finish immediately.</p>
483
+
<pclass="tip">Lors de l'utilisation de transitions uniquement JavaScript, **les fonctions de retour `done` sont obligatoires pour les hooks `enter` et `leave`**. Dans le cas contraire, elles seront appelées de façon synchrone et la transition se terminera immédiatement.</p>
484
484
485
-
<pclass="tip">It's also a good idea to explicitly add `v-bind:css="false"` for JavaScript-only transitions so that Vue can skip the CSS detection. This also prevents CSS rules from accidentally interfering with the transition.</p>
485
+
<pclass="tip">C'est aussi une bonne idée d'ajouter explicitement `v-bind:css="false"` pour les transitions uniquement JavaScript afin que Vue puisse ignorer la détection CSS. Cela empêche également les règles CSS d'interfèrer accidentellement avec la transition.</p>
486
486
487
-
Now let's dive into an example. Here's a simple JavaScript transition using Velocity.js:
487
+
Maintenant, nous allons plonger dans un exemple. Voici une simple transition JavaScript à l'aide de Velocity.js:
488
488
489
489
```html
490
490
<!--
491
-
Velocity works very much like jQuery.animate and is
492
-
a great option for JavaScript animations
491
+
Velocity fonctionne aussi bien que jQuery.animate et est
@@ -504,7 +504,7 @@ a great option for JavaScript animations
504
504
v-bind:css="false"
505
505
>
506
506
<pv-if="show">
507
-
Demo
507
+
Démo
508
508
</p>
509
509
</transition>
510
510
</div>
@@ -541,15 +541,15 @@ new Vue({
541
541
{% raw %}
542
542
<divid="example-4"class="demo">
543
543
<button @click="show = !show">
544
-
Toggle
544
+
Permuter
545
545
</button>
546
546
<transition
547
547
v-on:before-enter="beforeEnter"
548
548
v-on:enter="enter"
549
549
v-on:leave="leave"
550
550
>
551
551
<p v-if="show">
552
-
Demo
552
+
Démo
553
553
</p>
554
554
</transition>
555
555
</div>
@@ -584,17 +584,17 @@ new Vue({
584
584
</script>
585
585
{% endraw %}
586
586
587
-
## Transitions on Initial Render
587
+
## Transitions sur le rendu initial
588
588
589
-
If you also want to apply a transition on the initial render of a node, you can add the`appear`attribute:
589
+
Si vous souhaitez également appliquer une transition sur le rendu initial d'un nœud, vous pouvez ajouter l'attribut`appear` :
590
590
591
591
```html
592
592
<transitionappear>
593
593
<!-- ... -->
594
594
</transition>
595
595
```
596
596
597
-
By default, this will use the transitions specified for entering and leaving. If you'd like however, you can also specify custom CSS classes:
597
+
Par défaut, cela utilisera les transitions spécifiées pour l’entrée et la sortie. Si vous le souhaitez, vous pouvez également spécifier des classes CSS personnalisées :
598
598
599
599
```html
600
600
<transition
@@ -607,7 +607,7 @@ By default, this will use the transitions specified for entering and leaving. If
607
607
</transition>
608
608
```
609
609
610
-
and custom JavaScript hooks:
610
+
et des hooks JavaScript personnalisés :
611
611
612
612
```html
613
613
<transition
@@ -621,63 +621,63 @@ and custom JavaScript hooks:
621
621
</transition>
622
622
```
623
623
624
-
## Transitioning Between Elements
624
+
## Transition entre éléments
625
625
626
-
We discuss [transitioning between components](#Transitioning-Between-Components) later, but you can also transition between raw elements using `v-if`/`v-else`. One of the most common two-element transitions is between a list container and a message describing an empty list:
626
+
Plus loin, nous parlons de [transition entre les composants](#Transitioning-Between-Components), mais vous pouvez également faire une transition entre des éléments bruts en utilisant `v-if`/`v-else`. L'une des transitions les plus courantes sur deux éléments est entre un conteneur de liste et un message décrivant une liste vide :
627
627
628
628
```html
629
629
<transition>
630
630
<tablev-if="items.length > 0">
631
631
<!-- ... -->
632
632
</table>
633
-
<pv-else>Sorry, no items found.</p>
633
+
<pv-else>Désolé, aucun élément trouvé.</p>
634
634
</transition>
635
635
```
636
636
637
-
This works well, but there's one caveat to be aware of:
637
+
Cela fonctionne bien, mais il y a une mise en garde à connaître :
638
638
639
-
<pclass="tip">When toggling between elements that have **the same tag name**, you must tell Vue that they are distinct elements by giving them unique `key` attributes. Otherwise, Vue's compiler will only replace the content of the element for efficiency. Even when technically unnecessary though, **it's considered good practice to always key multiple items within a `<transition>` component.**</p>
639
+
<pclass="tip">Lors de la permutation entre des éléments qui ont **le même nom de balise**, vous devez indiquer à Vue qu’ils sont des éléments distincts en lui donnant des attributs `key` uniques. Sinon, le compilateur de Vue ne remplacera que le contenu de l'élément dans le but d'être efficace. Cependant, même si c'est techniquement inutile, **c'est considéré comme une bonne pratique de toujours avoir une clé pour chaque élément dans un composant `<transition>`.**</p>
640
640
641
-
For example:
641
+
Par exemple :
642
642
643
643
```html
644
644
<transition>
645
645
<buttonv-if="isEditing"key="save">
646
-
Save
646
+
Sauver
647
647
</button>
648
648
<buttonv-elsekey="edit">
649
-
Edit
649
+
Modifier
650
650
</button>
651
651
</transition>
652
652
```
653
653
654
-
In these cases, you can also use the`key`attribute to transition between different states of the same element. Instead of using`v-if`and`v-else`, the above example could be rewritten as:
654
+
Dans ces cas, vous pouvez aussi utiliser l'attribut`key`pour effectuer une transition entre différents états du même élément. Au lieu d’utiliser`v-if`et`v-else`, l’exemple ci-dessus pourrait être réécrit ainsi :
655
655
656
656
```html
657
657
<transition>
658
658
<buttonv-bind:key="isEditing">
659
-
{{ isEditing ? 'Save' : 'Edit' }}
659
+
{{ isEditing ? 'Sauver' : 'Modifier' }}
660
660
</button>
661
661
</transition>
662
662
```
663
663
664
-
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:
664
+
Il est effectivement possible de faire une transition entre un nombre indéfini d'éléments, soit en utilisant plusieurs`v-if` ou soit en liant un élément unique à une propriété dynamique. Par exemple :
0 commit comments