1
- # Enter & Leave Transitions
1
+ # Enter & Leave トランジション
2
2
3
3
Vue は、DOM からアイテムが追加、更新、削除されたときにトランジション効果を適用するための方法を複数提供しています:
4
4
@@ -9,7 +9,7 @@ Vue は、DOM からアイテムが追加、更新、削除されたときにト
9
9
10
10
On this page, we'll only cover entering, leaving, and list transitions, but you can see the next section for [ managing state transitions] ( transitions-state.html ) .
11
11
12
- ## Transitioning Single Elements/Components
12
+ ## 単一要素/コンポーネントのトランジション
13
13
14
14
Vue は、` transition ` ラッパーコンポーネントを提供しています。このコンポーネントは、次のコンテキストにある要素やコンポーネントに entering/leaving トランジションを追加することを可能にします:
15
15
@@ -71,7 +71,7 @@ Vue.createApp(Demo).mount('#demo')
71
71
72
72
3 . もし、CSS トランジション/アニメーションが検出されず、JavaScript フックも提供されない場合、挿入、削除のいずれか、あるいは両方の DOM 操作を次のフレームでただちに実行します。(注意: ここでのフレームはブラウザのアニメーションフレームを指します。 Vue の ` nextTick ` のコンセプトのそれとは異なるものです)
73
73
74
- ### Transition Classes
74
+ ### トランジションクラス
75
75
76
76
<!-- これらはが直訳としては良いが、読みやすさで "以下は" を採用 -->
77
77
@@ -90,7 +90,7 @@ Vue.createApp(Demo).mount('#demo')
90
90
91
91
` v-enter-active ` と ` v-leave-active ` は、次のセクションの例で見ることができるような、enter/leave トランジションで異なるイージングカーブの指定を可能にします。
92
92
93
- ### CSS Transitions
93
+ ### CSS トランジション
94
94
95
95
トランジションを実現する最も一般な方法として、CSS トランジションを使います。これはシンプルな例です:
96
96
@@ -143,7 +143,7 @@ Vue.createApp(Demo).mount('#demo')
143
143
</p >
144
144
<script async src =" https://static.codepen.io/assets/embed/ei.js " ></script >
145
145
146
- ### CSS Animations
146
+ ### CSS アニメーション
147
147
148
148
CSS アニメーションは、CSS トランジションと同じように適用されますが、異なるのは ` v-enter-from ` が要素が挿入された直後に削除されないことです。しかし、` animationend ` イベント時には削除されています。
149
149
@@ -201,7 +201,7 @@ Vue.createApp(Demo).mount('#demo')
201
201
</p >
202
202
<script async src =" https://static.codepen.io/assets/embed/ei.js " ></script >
203
203
204
- ### Custom Transition Classes
204
+ ### カスタムトランジションクラス
205
205
206
206
次の属性で、カスタムトランジションクラスを指定できます:
207
207
@@ -250,12 +250,13 @@ const Demo = {
250
250
Vue .createApp (Demo).mount (' #demo' )
251
251
```
252
252
253
- ### Using Transitions and Animations Together
253
+ ### トランジションとアニメーションの併用
254
254
255
255
Vue はトランジションが終了したことを把握するためのイベントリスナのアタッチを必要とします。イベントは、適用される CSS ルールに応じて ` transitionend ` か ` animationend ` のいずれかのタイプになります。あなたがトランジションとアニメーション、どちらか一方だけ使用する場合は、Vue は自動的に正しいタイプを判断することができます。
256
256
257
257
しかし、例えば、ホバーの CSS トランジション効果と Vue による CSS アニメーションのトリガの両方を持つ場合など、時には、同じ要素に両方を使うこともあるかもしれません。これらのケースでは、Vue に扱って欲しいタイプを ` type ` 属性で明示的に宣言するべきでしょう。この属性の値は、` animation ` あるいは ` transition ` を取ります。
258
- ### Explicit Transition Durations
258
+
259
+ ### 明示的なトランジション期間の設定
259
260
260
261
TODO: validate and provide an example
261
262
@@ -275,7 +276,7 @@ TODO: validate and provide an example
275
276
<transition :duration =" { enter: 500, leave: 800 }" >...</transition >
276
277
```
277
278
278
- ### JavaScript Hooks
279
+ ### JavaScript フック
279
280
280
281
属性によって JavaScript フックを定義することができます:
281
282
@@ -419,7 +420,7 @@ Vue.createApp(Demo).mount('#demo')
419
420
</p >
420
421
<script async src =" https://static.codepen.io/assets/embed/ei.js " ></script >
421
422
422
- ## Transitions on Initial Render
423
+ ## 初期描画時のトランジション
423
424
424
425
ノードの初期描画時にトランジションを適用したい場合は、` appear ` 属性を追加することができます:
425
426
@@ -429,7 +430,7 @@ Vue.createApp(Demo).mount('#demo')
429
430
</transition >
430
431
```
431
432
432
- ## Transitioning Between Elements
433
+ ## 要素間のトランジション
433
434
434
435
あとで [ コンポーネント間のトランジション] ( #コンポーネント間のトランジション ) について説明しますが、` v-if ` /` v-else ` を使った通常の要素同士でもトランジションできます。最も共通の2つの要素のトランジションの例として、リストコンテナとリストが空と説明するメッセージの間で行うものがあります:
435
436
@@ -483,7 +484,7 @@ computed: {
483
484
}
484
485
```
485
486
486
- ### Transition Modes
487
+ ### トランジションモード
487
488
488
489
まだひとつ問題が残っています。以下のボタンをクリックしてください:
489
490
@@ -543,7 +544,7 @@ We can use this to coordinate more expressive movement, such as a folding card,
543
544
</p >
544
545
<script async src =" https://static.codepen.io/assets/embed/ei.js " ></script >
545
546
546
- ## Transitioning Between Components
547
+ ## コンポーネント間のトランジション
547
548
548
549
コンポーネント間のトランジションは、 ` key ` 属性が必要ではないのでさらに単純です。代わりに、ただ [ 動的コンポーネント] ( components.html#動的コンポーネント ) でラップするだけです:
549
550
0 commit comments