Skip to content

Commit 2ecdf99

Browse files
authored
Merge pull request #171 from vuejs-jp/feat/list-transition
doc: Tranlate list transition
2 parents 9c0e519 + 1fcf6cf commit 2ecdf99

File tree

1 file changed

+29
-29
lines changed

1 file changed

+29
-29
lines changed

src/guide/transitions-list.md

Lines changed: 29 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
1-
# List Transitions
1+
# リストのトランジション
22

3-
So far, we've managed transitions for:
3+
ここまでで、私たちが管理しているトランジションは以下です:
44

5-
- Individual nodes
6-
- Multiple nodes where only 1 is rendered at a time
5+
- 個別のノード
6+
- 一度だけレンダリングされる複数のノード
77

8-
So what about for when we have a whole list of items we want to render simultaneously, for example with `v-for`? In this case, we'll use the `<transition-group>` component. Before we dive into an example though, there are a few things that are important to know about this component:
8+
その上で、例えば `v-for` のように、全てをまとめてレンダーしたいリスト全体がある場合はどうしましょうか?このような場合では、 `<transition-group>` コンポーネントを利用します。ですが具体的な例を見る前に、コンポーネントについていくつかの重要なことを知っておく必要があります:
99

10-
- Unlike `<transition>`, it renders an actual element: a `<span>` by default. You can change the element that's rendered with the `tag` attribute.
11-
- [Transition modes](/guide/transitions-enterleave#transition-modes) are not available, because we are no longer alternating between mutually exclusive elements.
12-
- Elements inside are **always required** to have a unique `key` attribute.
13-
- CSS transition classes will be applied to inner elements and not to the group/container itself.
10+
- `<transition>` とは異なり、デフォルトで実際の `<span>` 要素をレンダリングします。レンダリングされる要素は、 `tag` 属性によって変更できます。
11+
- 2つの排他の要素が切り替わっているわけではないため、[Transition モード](/guide/transitions-enterleave#transition-modes) は利用できません。
12+
- 要素の内部では、 **常に** 固有の `key` 属性を **持つ必要** があります。
13+
- CSS トランジションクラスは内部の要素に適用され、グループやコンテナには適用されません。
1414

15-
### List Entering/Leaving Transitions
15+
### リストの Enter/Leave トランジション
1616

17-
Now let's dive into an example, transitioning entering and leaving using the same CSS classes we've used previously:
17+
早速例に飛び込んでみましょう。以前利用したものと同じ CSS クラスを利用して、 enter/leave を行います:
1818

1919
```html
2020
<div id="list-demo">
@@ -75,13 +75,13 @@ Vue.createApp(Demo).mount('#list-demo')
7575
</p>
7676
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
7777

78-
There's one problem with this example. When you add or remove an item, the ones around it instantly snap into their new place instead of smoothly transitioning. We'll fix that later.
78+
この例には一つの問題があります。item を追加や削除を行うと、その item の周りのものがスムーズに遷移せず、すぐに移動してしまいます。これは後で修正します。
7979

8080
### List Move Transitions
8181

82-
The `<transition-group>` component has another trick up its sleeve. It can not only animate entering and leaving, but also changes in position. The only new concept you need to know to use this feature is the addition of **the `v-move` class**, which is added when items are changing positions. Like the other classes, its prefix will match the value of a provided `name` attribute and you can also manually specify a class with the `move-class` attribute.
82+
`<transition-group>` コンポーネントはもう一つの機能を持っています。それは、 enter/leave にだけでなく、位置の変更もアニメーションできることです。この機能を利用するための概念として、要素が位置を変更するときに **`v-move` クラス** が追加されることを知る必要があります。これはその他のクラスと同様、接頭辞はトランジションの `name` 属性と一致しているほか、 `move-class` 属性で手動でクラスを指定できます。
8383

84-
This class is mostly useful for specifying the transition timing and easing curve, as you'll see below:
84+
このクラスは、後述のようにトランジションのタイミングや easing カーブを設定する際に便利です。
8585

8686
```html
8787
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.17.15/lodash.min.js"></script>
@@ -126,9 +126,9 @@ Vue.createApp(Demo).mount('#flip-list-demo')
126126
</p>
127127
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
128128

129-
This might seem like magic, but under the hood, Vue is using an animation technique called [FLIP](https://aerotwist.com/blog/flip-your-animations/) to smoothly transition elements from their old position to their new position using transforms.
129+
これは魔法のように見えますが、Vue [FLIP](https://aerotwist.com/blog/flip-your-animations/) と呼ばれるアニメーションのテクニックによって、transform を利用した要素の位置をスムーズに遷移させています。
130130

131-
We can combine this technique with our previous implementation to animate every possible change to our list!
131+
このテクニックと前の実装を組み合わせることで、リストへの変更をアニメーションさせることができます!
132132

133133
```html
134134
<script src="https://cdnjs.cloudflare.com/ajax/libs/lodash.js/4.14.1/lodash.min.js"></script>
@@ -198,16 +198,16 @@ Vue.createApp(Demo).mount('#list-complete-demo')
198198
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
199199

200200
::: tip
201-
One important note is that these FLIP transitions do not work with elements set to `display: inline`. As an alternative, you can use `display: inline-block` or place elements in a flex context.
201+
重大な注意点として、これらの FLIP トランジションは、 `display: inline` が設定された要素では動作しません。代わりに、 `display: inline-block` を利用するか、または flex コンテキスト内に要素を配置することとなります。
202202
:::
203203

204-
These FLIP animations are also not limited to a single axis. Items in a multidimensional grid can be [transitioned too](https://codesandbox.io/s/github/vuejs/vuejs.org/tree/master/src/v2/examples/vue-20-list-move-transitions):
204+
これらの FLIP アニメーションは、一つの軸の動作に限定されません。多次元のグリッドに対しても、[同様に](https://codesandbox.io/s/github/vuejs/vuejs.org/tree/master/src/v2/examples/vue-20-list-move-transitions)操作できます:
205205

206206
TODO: example
207207

208-
### Staggering List Transitions
208+
### 時間差でのリストトランジション
209209

210-
By communicating with JavaScript transitions through data attributes, it's also possible to stagger transitions in a list:
210+
data 属性によって JavaScript によるトランジションと通信することで、時間差でのリストトランジションが可能となります:
211211

212212
```html
213213
<script src="https://cdnjs.cloudflare.com/ajax/libs/gsap/3.3.4/gsap.min.js"></script>
@@ -289,13 +289,13 @@ Vue.createApp(Demo).mount('#demo')
289289
</p>
290290
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
291291

292-
## Reusable Transitions
292+
## 再利用可能なトランジション
293293

294-
Transitions can be reused through Vue's component system. To create a reusable transition, all you have to do is place a `<transition>` or `<transition-group>` component at the root, then pass any children into the transition component.
294+
トランジション群は、 Vue のコンポーネントシステムによって再利用できます。再利用可能なトランジションを作るためには、コンポーネントのルートに `<transition>` または `<transition-group>` を配置し、その children をトランジションコンポーネントへと渡すだけです。
295295

296296
TODO: refactor to Vue 3
297297

298-
Here's an example using a template component:
298+
これらは、template コンポーネントを利用した例です:
299299

300300
```js
301301
Vue.component('my-special-transition', {
@@ -320,7 +320,7 @@ Vue.component('my-special-transition', {
320320
})
321321
```
322322

323-
And [functional components](render-function.html#Functional-Components) are especially well-suited to this task:
323+
そして[関数型コンポーネント](render-function.html#Functional-Components)は、このようなタスクに時に適しています:
324324

325325
```js
326326
Vue.component('my-special-transition', {
@@ -345,19 +345,19 @@ Vue.component('my-special-transition', {
345345
})
346346
```
347347

348-
## Dynamic Transitions
348+
## 動的なトランジション
349349

350-
Yes, even transitions in Vue are data-driven! The most basic example of a dynamic transition binds the `name` attribute to a dynamic property.
350+
そうです!Vue では、トランジションの設定さえもデータ駆動となります。動的なトランジション設定の最も基本的な例は、 `name` 属性を動的なプロパティに紐付けるものです。
351351

352352
```html
353353
<transition :name="transitionName">
354354
<!-- ... -->
355355
</transition>
356356
```
357357

358-
This can be useful when you've defined CSS transitions/animations using Vue's transition class conventions and want to switch between them.
358+
これは Vue のトランジションクラスの規約によって、 CSS トランジション/アニメーションを定義し、切り替えたい場合に便利です。
359359

360-
Really though, any transition attribute can be dynamically bound. And it's not only attributes. Since event hooks are methods, they have access to any data in the context. That means depending on the state of your component, your JavaScript transitions can behave differently.
360+
そしてこれは本当にあらゆるトランジション属性を動的に紐付けることができ、その対象は属性だけではありません。イベントフックはメソッドであるため、コンテキストにおけるあらゆるデータへとアクセスすることができます。それはコンポーネントの状態に依存して、 JavaScript トランジションが異なる挙動する可能性があるということです。
361361

362362
```html
363363
<script src="https://cdnjs.cloudflare.com/ajax/libs/velocity/1.2.3/velocity.min.js"></script>
@@ -441,4 +441,4 @@ app.mount('#dynamic-fade-demo')
441441

442442
TODO: example
443443

444-
Finally, the ultimate way of creating dynamic transitions is through components that accept props to change the nature of the transition(s) to be used. It may sound cheesy, but the only limit really is your imagination.
444+
最後に、究極的には、プロップを受け付けるコンポーネントを利用し、性質を変化させる、動的なトランジションを実現することができます。安っぽい表現に聞こえるかもしれませんが、限界はあなたの想像力次第です。

0 commit comments

Comments
 (0)