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
-**NEW:**`key`s are no longer necessary on `v-if`/`v-else`/`v-else-if`branches, since Vue now automatically generates unique `key`s.
11
-
-**BREAKING:**If you manually provide `key`s, then each branch must use a unique `key`. You can no longer intentionally use the same `key`to force branch reuse.
12
-
-**BREAKING:**`<template v-for>``key`should be placed on the `<template>`tag (rather than on its children).
The`key`special attribute is used as a hint for Vue's virtual DOM algorithm to keep track of a node's identity. That way, Vue knows when it can reuse and patch existing nodes and when it needs to reorder or recreate them. For more information, see the following sections:
16
+
特別な属性`key`は、Vue の仮想 DOM アルゴリズムがノードの ID を追跡するためのヒントとして使用されます。これにより、Vue は既存のノードを再利用したりパッチを当てたりできるタイミングや、ノードの並び替えや再作成が必要なタイミングを知ることができます。詳細については、下記のセクションを参照してください。
The example above still works in Vue 3.x. However, we no longer recommend using the `key` attribute on `v-if`/`v-else`/`v-else-if`branches, since unique`key`s are now automatically generated on conditional branches if you don't provide them.
-**BREAKING**: Order of bindings for v-bind will affect the rendering result.
11
+
-**破壊的変更**: v-bind のバインディングの順番は、レンダリング結果に影響します。
12
12
13
-
## Introduction
13
+
## はじめに
14
14
15
-
When dynamically binding attributes on an element, a common scenario involves using both the `v-bind="object"`syntax as well as individual attributes in the same element. However, this raises questions as far as the priority of merging.
In 2.x, if an element has both `v-bind="object"`and an identical individual attribute defined, the individual attribute would always overwrite bindings in the `object`.
In 3x, if an element has both `v-bind="object"`and an identical individual attribute defined, the order of how the bindings are declared determines how they are merged. In other words, rather than assuming developers want the individual attribute to always override what is defined in the `object`, developers now have more control over the desired merging behavior.
If you are relying on this override functionality for `v-bind`, we currently recommend ensuring that your `v-bind`attribute is defined before individual attributes.
Two of the most commonly used directives in Vue.js are`v-if`and`v-for`. So it's no surprise that there comes a time when developers want to use both together. While this is not a recommended practice, there may be times when this is necessary, so we wanted to provide guidance for how it works.
In 3.x, `v-if`will always have the higher precedence than `v-for`.
23
+
3.x では、`v-if`は常に `v-for` より優先度が高くなります。
24
24
25
-
## Migration Strategy
25
+
## 移行手順
26
26
27
-
It is recommended to avoid using both on the same element due to the syntax ambiguity.
27
+
構文があいまいなため、同じ要素で両方を使用することは避けることをお勧めします。
28
28
29
-
Rather than managing this at the template level, one method for accomplishing this is to create a computed property that filters out a list for the visible elements.
0 commit comments