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/guide/transitions-list.md
+29-29Lines changed: 29 additions & 29 deletions
Original file line number
Diff line number
Diff line change
@@ -1,20 +1,20 @@
1
-
# List Transitions
1
+
# リストのトランジション
2
2
3
-
So far, we've managed transitions for:
3
+
ここまでで、私たちが管理しているトランジションは以下です:
4
4
5
-
-Individual nodes
6
-
-Multiple nodes where only 1 is rendered at a time
5
+
-個別のノード
6
+
-一度だけレンダリングされる複数のノード
7
7
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:
-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.
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.
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.
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.
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.
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):
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 をトランジションコンポーネントへと渡すだけです。
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.
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.
0 commit comments