|
1 | 1 | ---
|
2 |
| -title: v-bind Merge Behavior |
| 2 | +title: Comportamento ao Combinar v-bind |
3 | 3 | badges:
|
4 | 4 | - breaking
|
5 | 5 | ---
|
6 | 6 |
|
7 | 7 | # {{ $frontmatter.title }} <MigrationBadges :badges="$frontmatter.badges" />
|
8 | 8 |
|
9 |
| -## Overview |
| 9 | +## Visão Geral |
10 | 10 |
|
11 |
| -- **BREAKING**: Order of bindings for v-bind will affect the rendering result. |
| 11 | +- **QUEBRA**: A ordem das vinculações para `v-bind` irá afetar o resultado da renderização. |
12 | 12 |
|
13 |
| -## Introduction |
| 13 | +## Visão Geral |
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 properties in the same element. However, this raises questions as far as the priority of merging. |
| 15 | +Quando se está dinamicamente vinculando atributos em um elemento, um cenário comum envolve utilizar tanto a sintaxe `v-bind="object"` quanto as propriedades indiviuais no mesmo elemento. Contudo, isso gera questões tal como a prioridade na combinação. |
16 | 16 |
|
17 |
| -## 2.x Syntax |
| 17 | +## Sintaxe 2.x |
18 | 18 |
|
19 |
| -In 2.x, if an element has both `v-bind="object"` and an identical individual property defined, the individual property would always overwrite bindings in the `object`. |
| 19 | +No 2.x, se um elemento tem tanto o `v-bind="object"` quanto uma propriedade individual idêntica definida, a propriedade individual sempre vai sobrescrever as vinculações do `object`. |
20 | 20 |
|
21 | 21 | ```html
|
22 | 22 | <!-- template -->
|
23 | 23 | <div id="red" v-bind="{ id: 'blue' }"></div>
|
24 |
| -<!-- result --> |
| 24 | +<!-- resultado --> |
25 | 25 | <div id="red"></div>
|
26 | 26 | ```
|
27 | 27 |
|
28 |
| -## 3.x Syntax |
| 28 | +## Sintaxe v3.x |
29 | 29 |
|
30 |
| -In 3x, if an element has both `v-bind="object"` and an identical individual property defined, the order of how the bindings are declared determines how they are merged. In other words, rather than assuming developers want the individual property to always override what is defined in the `object`, developers now have more control over the desired merging behavior. |
| 30 | +Na v3.x, se um elemento tem tanto o `v-bind="object"` quanto uma propriedade individual idêntica definida, a ordem de como as vinculações são declaradas determina como elas serão combinadas. Em outras palavras, em vez de assumir que os desenvolvedores querem que a propriedade individual sempre sobrescreva o que está definido no `object`, agora os desenvolvedores terão mais controle sobre qual o comportamento desejado na combinação. |
31 | 31 |
|
32 | 32 | ```html
|
33 | 33 | <!-- template -->
|
34 | 34 | <div id="red" v-bind="{ id: 'blue' }"></div>
|
35 |
| -<!-- result --> |
| 35 | +<!-- resultado --> |
36 | 36 | <div id="blue"></div>
|
37 | 37 |
|
38 | 38 | <!-- template -->
|
39 | 39 | <div v-bind="{ id: 'blue' }" id="red"></div>
|
40 |
| -<!-- result --> |
| 40 | +<!-- resultado --> |
41 | 41 | <div id="red"></div>
|
42 | 42 | ```
|
43 | 43 |
|
44 |
| -## Migration Strategy |
| 44 | +## Estratégia de Migração |
45 | 45 |
|
46 |
| -If you are relying on this override functionality for `v-bind`, we currently recommend ensuring that your `v-bind` attribute is defined before individual properties. |
| 46 | +Se você está confiando nessa funcionalidade de sobrescrita do `v-bind`, nós atualmente recomendamos você à garantir que seu atributo `v-bind` seja definido sempre antes das propriedades individuais. |
0 commit comments