Skip to content

Commit 03671e1

Browse files
authored
Merge pull request #153 from thiagotakehana/translate-array-refs
translated guide/migration/array-refs.md to pt-BR
2 parents a77e84c + 8d8bec8 commit 03671e1

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

src/guide/migration/array-refs.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
---
2-
title: v-for Array Refs
2+
title: Array Refs no v-for
33
badges:
44
- breaking
55
---
66

77
# {{ $frontmatter.title }} <MigrationBadges :badges="$frontmatter.badges" />
88

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.
9+
No Vue 2, usar o atributo `ref` dentro do `v-for` irá preencher a propriedade `$refs` correspondente com um Array de `refs`. Este comportamento se torna ambíguo e ineficiente quando existem `v-for` aninhados.
1010

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):
11+
No Vue 3, tal uso não mais criará automaticamente um Array em `$refs`. Para recuperar várias referências de uma única ligação, vincule `ref` à uma função que forneça mais flexibilidade (este é um novo recurso):
1212

1313
```html
1414
<div v-for="item in list" :ref="setItemRef"></div>
1515
```
1616

17-
With Options API:
17+
Com API de Opções:
1818

1919
```js
2020
export default {
@@ -37,7 +37,7 @@ export default {
3737
}
3838
```
3939

40-
With Composition API:
40+
Com API de Composição:
4141

4242
```js
4343
import { ref, onBeforeUpdate, onUpdated } from 'vue'
@@ -62,8 +62,8 @@ export default {
6262
}
6363
```
6464

65-
Note that:
65+
Observe que:
6666

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

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

0 commit comments

Comments
 (0)