Skip to content

Commit 2b5a817

Browse files
author
Takehana
committed
translated guide/migration/array-refs.md to pt-BR
1 parent 035051c commit 2b5a817

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/guide/migration/array-refs.md

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,19 @@
11
---
2-
title: v-for Array Refs
32
badges:
43
- breaking
54
---
65

7-
# {{ $frontmatter.title }} <MigrationBadges :badges="$frontmatter.badges" />
6+
# v-for Array Refs
87

9-
In Vue 2, using the `ref` attribute inside `v-for` will populate the corresponding `$refs` property with an array of refs. This behavior becomes ambiguous and inefficient when there are nested `v-for`s present.
8+
No Vue 2, usar o atributo `ref` dentro de `v-for` irá preencher a propriedade `$refs` correspondente com uma Array de `refs`. Este comportamento se torna ambíguo e ineficiente quando estão aninhados de `v-for` presentes.
109

11-
In Vue 3, such usage will no longer automatically create an array in `$refs`. To retrieve multiple refs from a single binding, bind `ref` to a function which provides more flexibility (this is a new feature):
10+
No Vue 3, tal uso não criará mais automaticamente uma Array em `$refs`. Para recuperar vários `refs` de uma única ligação, vincule `ref` a uma função que forneça mais flexibilidade (este é um novo recurso):
1211

1312
```html
1413
<div v-for="item in list" :ref="setItemRef"></div>
1514
```
1615

17-
With Options API:
16+
Com opções API:
1817

1918
```js
2019
export default {
@@ -37,7 +36,7 @@ export default {
3736
}
3837
```
3938

40-
With Composition API:
39+
Com composição API:
4140

4241
```js
4342
import { ref, onBeforeUpdate, onUpdated } from 'vue'
@@ -62,8 +61,8 @@ export default {
6261
}
6362
```
6463

65-
Note that:
64+
Observe que:
6665

67-
- `itemRefs` doesn't have to be an array: it can also be an object where the refs are set by their iteration keys.
66+
- `itemRefs` não precisa ser uma Array: também pode ser um objeto onde os `refs` são definidos por suas chaves de iteração.
6867

69-
- This also allows `itemRefs` to be made reactive and watched, if needed.
68+
- Isso também permite que `itemRefs` sejam reativos e observados, se necessário.

0 commit comments

Comments
 (0)