Skip to content

Commit eabaae0

Browse files
mono0xkazupon
authored andcommitted
Translate "Transitioning State" (vuejs#138) (vuejs#180)
1 parent a833794 commit eabaae0

File tree

1 file changed

+21
-22
lines changed

1 file changed

+21
-22
lines changed

src/guide/transitioning-state.md

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11
---
2-
title: Transitioning State
2+
title: 状態のトランジション
33
type: guide
44
order: 13
55
---
66

7-
Vue's transition system offers many simple ways to animate entering, leaving, and lists, but what about animating your data itself? For example:
7+
Vue のトランジションシステムは enteringleaving、およびリストをアニメーションさせるための多くの単純な方法を提供しますが、あなたのデータ自体をアニメーションさせる場合はどうでしょうか?例えば:
88

9-
- numbers and calculations
10-
- colors displayed
11-
- the positions of SVG nodes
12-
- the sizes and other properties of elements
9+
- 数値と計算
10+
- 表示される色
11+
- SVG ノードの位置
12+
- 要素のサイズやその他のプロパティ
1313

14-
All of these are either already stored as raw numbers or can be converted into numbers. Once we do that, we can animate these state changes using 3rd-party libraries to tween state, in combination with Vue's reactivity and component systems.
14+
これらはすべて、生の数値として保持されているか、あるいは数値に変換することが可能です。一度それをすれば、Vue のリアクティブな性質とコンポーネントシステムの組み合わせにより、状態から中間フレームを生成するためのサードパーティのライブラリを使ってアニメーションさせることができます。
1515

16-
## Animating State with Watchers
16+
## ウォッチャによる状態のアニメーション
1717

18-
Watchers allow us to animate changes of any numerical property into another property. That may sound complicated in the abstract, so let's dive into an example using Tween.js:
18+
ウォッチャは、任意の数値プロパティの変化によって他のプロパティをアニメーションさせることができるようにします。それは理論的には複雑に聞こえるかもしれませんが、Tween.js を使った例に没頭してみましょう:
1919

2020
``` html
2121
<script src="https://unpkg.com/[email protected]"></script>
@@ -87,7 +87,7 @@ new Vue({
8787
</script>
8888
{% endraw %}
8989

90-
When you update the number, the change is animated below the input. This makes for a nice demo, but what about something that isn't directly stored as a number, like any valid CSS color for example? Here's how we could accomplish this with the addition of Color.js:
90+
数値を更新すると、その変更が入力の下でアニメーションします。これはよいデモですが、例えば有効な CSS の色のように、直接的に数値として保持されていないものの場合はどうでしょうか?こちらのように、Color.js を加えることによってそれを成し遂げられます:
9191

9292
``` html
9393
<script src="https://unpkg.com/[email protected]"></script>
@@ -239,9 +239,9 @@ new Vue({
239239
</style>
240240
{% endraw %}
241241

242-
## Dynamic State Transitions
242+
## 動的な状態のトランジション
243243

244-
Just as with Vue's transition components, the data backing state transitions can be updated in real time, which is especially useful for prototyping! Even using a simple SVG polygon, you can achieve many effects that would be difficult to conceive of until you've played with the variables a little.
244+
Vue のトランジションコンポーネントを使う場合と同様に、状態のトランジションの背後にあるデータはリタルタイムに更新でき、これは特にプロトタイピングにおいて便利です!単純な SVG のポリゴンに使用して、変数で少し遊ぶだけで、それまで思い付くのが難しかった多くの効果を得られます。
245245

246246
{% raw %}
247247
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/1.18.5/TweenLite.min.js"></script>
@@ -374,11 +374,11 @@ function generatePoints (stats) {
374374
</style>
375375
{% endraw %}
376376

377-
See [this fiddle](https://jsfiddle.net/chrisvfritz/65gLu2b6/) for the complete code behind the above demo.
377+
上記のデモの背後にある完全なコードについては[この Fiddle](https://jsfiddle.net/chrisvfritz/65gLu2b6/) を参照してください。
378378

379-
## Organizing Transitions into Components
379+
## コンポーネント内のトランジションの整理
380380

381-
Managing many state transitions can quickly increase the complexity of a Vue instance or component. Fortunately, many animations can be extracted out into dedicated child components. Let's do this with the animated integer from our earlier example:
381+
多くの状態のトランジションを管理することで、素早く Vue インスタンスやコンポーネントの複雑さを増加させることができます。幸いにも、多くのアニメーションは専用の子コンポーネントに抽出できます。前の例のアニメーションする数値でこれをやってみましょう:
382382

383383
``` html
384384
<script src="https://unpkg.com/[email protected]"></script>
@@ -396,11 +396,10 @@ Managing many state transitions can quickly increase the complexity of a Vue ins
396396
```
397397

398398
``` js
399-
// This complex tweening logic can now be reused between
400-
// any integers we may wish to animate in our application.
401-
// Components also offer a clean interface for configuring
402-
// more dynamic transitions and complex transition
403-
// strategies.
399+
// この複雑な中間フレーム生成ロジックは現在、アプリケーション内の
400+
// アニメーションさせたいと望むあらゆる数値で再利用できます。
401+
// コンポーネントは、よりダイナミックなトランジションと複雑な
402+
// トランジション戦略を構成するクリーンなインターフェイスを提供します。
404403
Vue.component('animated-integer', {
405404
template: '<span>{{ tweeningValue }}</span>',
406405
props: {
@@ -440,7 +439,7 @@ Vue.component('animated-integer', {
440439
}
441440
})
442441

443-
// All complexity has now been removed from the main Vue instance!
442+
// すべての複雑さがメインの Vue インスタンスから取り除かれました!
444443
new Vue({
445444
el: '#example-8',
446445
data: {
@@ -521,4 +520,4 @@ new Vue({
521520
</script>
522521
{% endraw %}
523522

524-
Within child components, we can use any combination of transition strategies that have been covered on this page, along with those offered by Vue's [built-in transition system](transitions.html). Together, there are very few limits to what can be accomplished.
523+
子コンポーネントの中では、Vue[組み込みのトランジションシステム](transitions.html)によるものと同時に、このページで取り扱ったあらゆるトランジション戦略の組み合わせを利用できます。同時に、達成できることにはごくわずかの制限があります。

0 commit comments

Comments
 (0)