Skip to content

Commit 59ca923

Browse files
committed
Merge branch 'master' into pr/262
2 parents 25d85f3 + 97f4614 commit 59ca923

36 files changed

+894
-894
lines changed

src/api/application-api.md

+104-104
Large diffs are not rendered by default.

src/api/application-config.md

+65-65
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,58 @@
1-
# Application Config
1+
# Configuração da Aplicação
22

3-
Every Vue application exposes a `config` object that contains the configuration settings for that application:
3+
Todo aplicativo Vue expõe um objeto `config` que contém as configurações para esse aplicativo:
44

55
```js
66
const app = createApp({})
77

88
console.log(app.config)
99
```
1010

11-
You can modify its properties, listed below, before mounting your application.
11+
Você pode modificar suas propriedades, listadas abaixo, antes de montar a sua aplicação.
1212

1313
## errorHandler
1414

15-
- **Type:** `Function`
15+
- **Tipo:** `Function`
1616

17-
- **Default:** `undefined`
17+
- **Padrão:** `undefined`
1818

19-
- **Usage:**
19+
- **Uso:**
2020

2121
```js
2222
app.config.errorHandler = (err, vm, info) => {
23-
// handle error
24-
// `info` is a Vue-specific error info, e.g. which lifecycle hook
25-
// the error was found in
23+
// manipula erro
24+
// `info` traz informações de erros específicos do Vue,
25+
// ex.: em qual gatilho do ciclo de vida o erro foi encontrado
2626
}
2727
```
2828

29-
Assign a handler for uncaught errors during component render function and watchers. The handler gets called with the error and the application instance.
29+
Atribua um manipulador para erros não capturados durante a função de renderização do componente e os observadores. O manipulador é chamado com o erro e a instância da aplicação.
3030

31-
> Error tracking services [Sentry](https://sentry.io/for/vue/) and [Bugsnag](https://docs.bugsnag.com/platforms/browsers/vue/) provide official integrations using this option.
31+
> Os serviços de rastreamento de erros [Sentry](https://sentry.io/for/vue/) e [Bugsnag](https://docs.bugsnag.com/platforms/browsers/vue/) fornecem integrações oficiais usando essa opção.
3232
3333
## warnHandler
3434

35-
- **Type:** `Function`
35+
- **Tipo:** `Function`
3636

37-
- **Default:** `undefined`
37+
- **Padrão:** `undefined`
3838

39-
- **Usage:**
39+
- **Uso:**
4040

4141
```js
4242
app.config.warnHandler = function(msg, vm, trace) {
43-
// `trace` is the component hierarchy trace
43+
// `trace` é o rastro da hierarquia do componente
4444
}
4545
```
4646

47-
Assign a custom handler for runtime Vue warnings. Note this only works during development and is ignored in production.
47+
Atribua um manipulador customizado para avisos do Vue em tempo de execução. Note que isso funciona apenas durante o desenvolvimento e é ignorado em produção.
4848

4949
## globalProperties
5050

51-
- **Type:** `[key: string]: any`
51+
- **Tipo:** `[key: string]: any`
5252

53-
- **Default:** `undefined`
53+
- **Padrão:** `undefined`
5454

55-
- **Usage:**
55+
- **Uso:**
5656

5757
```js
5858
app.config.globalProperties.foo = 'bar'
@@ -64,9 +64,9 @@ app.component('child-component', {
6464
})
6565
```
6666

67-
Adds a global property that can be accessed in any component instance inside the application. The component’s property will take priority when there are conflicting keys.
67+
Adiciona uma propriedade global que pode ser acessada em qualquer instância de componente dentro da aplicação. A propriedade do componente terá prioridade quando houver chaves conflitantes.
6868

69-
This can replace Vue 2.x `Vue.prototype` extending:
69+
Isto pode substituir o ato de estender o `Vue.prototype` no Vue 2.x:
7070

7171
```js
7272
// Before
@@ -79,11 +79,11 @@ app.config.globalProperties.$http = () => {}
7979

8080
## optionMergeStrategies
8181

82-
- **Type:** `{ [key: string]: Function }`
82+
- **Tipo:** `{ [key: string]: Function }`
8383

84-
- **Default:** `{}`
84+
- **Padrão:** `{}`
8585

86-
- **Usage:**
86+
- **Uso:**
8787

8888
```js
8989
const app = createApp({
@@ -93,116 +93,116 @@ const app = createApp({
9393
})
9494

9595
app.config.optionMergeStrategies.hello = (parent, child) => {
96-
return `Hello, ${child}`
96+
return `Olá, ${child}`
9797
}
9898

9999
app.mixin({
100100
hello: 'Vue'
101101
})
102102

103-
// 'Hello, Vue'
103+
// 'Olá, Vue'
104104
```
105105

106-
Define merging strategies for custom options.
106+
Defina estratégias de mesclagem para opções customizadas.
107107

108-
The merge strategy receives the value of that option defined on the parent and child instances as the first and second arguments, respectively.
108+
A estratégia de mesclagem recebe o valor daquela opção definida nas instâncias de pai e filho como primeiro e segundo argumentos, respectivamente.
109109

110-
- **See also:** [Custom Option Merging Strategies](../guide/mixins.html#custom-option-merge-strategies)
110+
- **Ver também:** [Estratégias de Mesclagem de Opções Personalizadas](../guide/mixins.html#estrategias-de-mesclagem-de-opcoes-personalizadas)
111111

112112
## performance
113113

114-
- **Type:** `boolean`
114+
- **Tipo:** `boolean`
115115

116-
- **Default:** `false`
116+
- **Padrão:** `false`
117117

118-
- **Usage**:
118+
- **Uso**:
119119

120-
Set this to `true` to enable component init, compile, render and patch performance tracing in the browser devtool performance/timeline panel. Only works in development mode and in browsers that support the [performance.mark](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark) API.
120+
Defina isto como `true` para habilitar a inicialização, compilação, renderização e rastreamento do desempenho de correções do componente no painel de desempenho ou linha do tempo no devtool do navegador. Funciona apenas em modo de desenvolvimento e em navegadores que suportam a API [performance.mark](https://developer.mozilla.org/en-US/docs/Web/API/Performance/mark).
121121

122122
## compilerOptions <Badge text="3.1+" />
123123

124-
- **Type:** `Object`
124+
- **Tipo:** `Object`
125125

126-
Configure runtime compiler options. Values set on this object will be passed to the in-browser template compiler and affect every component in the configured app. Note you can also override these options on a per-component basis using the [`compilerOptions` option](/api/options-misc.html#compileroptions).
126+
Configure as opções do compilador de tempo de execução. Os valores definidos neste objeto serão passados para o compilador de _template_ no navegador e afetarão todos os componentes no app configurado. Note que você também pode sobrepor essas opções por componente usando a [opção `compilerOptions`](/api/options-misc.html#compileroptions).
127127

128-
::: tip Important
129-
This config option is only respected when using the full build (i.e. the standalone `vue.js` that can compile templates in the browser). If you are using the runtime-only build with a build setup, compiler options must be passed to `@vue/compiler-dom` via build tool configurations instead.
128+
::: tip Importante
129+
Esta opção de configuração só é respeitada ao usar a compilação completa (ou seja, o `vue.js` independente que pode compilar _templates_ no navegador). Se você utilizar a compilação de tempo de execução (_runtime_) em um ambiente de construção, então as opções do compilador devem ser passadas para `@vue/compiler-dom` através das configurações da ferramenta de construção.
130130

131-
- For `vue-loader`: [pass via the `compilerOptions` loader option](https://vue-loader.vuejs.org/options.html#compileroptions). Also see [how to configure it in `vue-cli`](https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader).
131+
- Para `vue-loader`: [passe pela opção `compilerOptions` do loader](https://vue-loader.vuejs.org/options.html#compileroptions). Veja também [como configurá-lo no `vue-cli`](https://cli.vuejs.org/guide/webpack.html#modifying-options-of-a-loader).
132132

133-
- For `vite`: [pass via `@vitejs/plugin-vue` options](https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom).
133+
- Para `vite`: [passe pelas opções do `@vitejs/plugin-vue`](https://github.com/vitejs/vite/tree/main/packages/plugin-vue#example-for-passing-options-to-vuecompiler-dom).
134134
:::
135135

136136
### compilerOptions.isCustomElement
137137

138-
- **Type:** `(tag: string) => boolean`
138+
- **Tipo:** `(tag: string) => boolean`
139139

140-
- **Default:** `undefined`
140+
- **Padrão:** `undefined`
141141

142-
- **Usage:**
142+
- **Uso:**
143143

144144
```js
145-
// any element starting with 'ion-' will be recognized as a custom one
145+
// qualquer elemento começando com 'ion-' será reconhecido como personalizado
146146
app.config.compilerOptions.isCustomElement = tag => tag.startsWith('ion-')
147147
```
148148

149-
Specifies a method to recognize custom elements defined outside of Vue (e.g., using the Web Components APIs). If component matches this condition, it won't need local or global registration and Vue won't throw a warning about an `Unknown custom element`.
149+
Especifica um método para reconhecer elementos personalizados definidos fora do Vue (ex.: usando APIs de _Web Components_). Caso um componente corresponda à essa condição, ele não precisará do registro local ou global e o Vue não lançará avisos sobre um elemento personalizado desconhecido (`Unknown custom element`).
150150

151-
> Note that all native HTML and SVG tags don't need to be matched in this function - Vue parser performs this check automatically.
151+
> Note que todas as tags de HTML nativo e SVG não precisam corresponder a esta função. O _parser_ do Vue desempenha esta conferência automaticamente.
152152
153153
### compilerOptions.whitespace
154154

155-
- **Type:** `'condense' | 'preserve'`
155+
- **Tipo:** `'condense' | 'preserve'`
156156

157-
- **Default:** `'condense'`
157+
- **Padrão:** `'condense'`
158158

159-
- **Usage:**
159+
- **Uso:**
160160

161161
```js
162162
app.config.compilerOptions.whitespace = 'preserve'
163163
```
164164

165-
By default, Vue removes/condenses whitespaces between template elements to produce more efficient compiled output:
165+
Por padrão, o Vue remove/condensa espaços em branco entre elementos do _template_ para produzir resultados compilados mais eficientes:
166166

167-
1. Leading / ending whitespaces inside an element are condensed into a single space
168-
2. Whitespaces between elements that contain newlines are removed
169-
3. Consecutive whitespaces in text nodes are condensed into a single space
167+
1. Espaços em branco no começo ou no fim de um elemento são condensados em um espaço único
168+
2. Espaços em branco entre elementos que contenham novas linhas são removidos
169+
3. Espaços em branco consecutivos em nós de texto são condensados em um único espaço.
170170

171-
Setting the value to `'preserve'` will disable (2) and (3).
171+
Definir o valor como `'preserve'` desabilitará ambos (2) e (3).
172172

173173
### compilerOptions.delimiters
174174

175-
- **Type:** `Array<string>`
175+
- **Tipo:** `Array<string>`
176176

177-
- **Default:** `{{ "['\u007b\u007b', '\u007d\u007d']" }}`
177+
- **Padrão:** `{{ "['\u007b\u007b', '\u007d\u007d']" }}`
178178

179-
- **Usage:**
179+
- **Uso:**
180180

181181
```js
182-
// Delimiters changed to ES6 template string style
182+
// Delimitadores modificados para o estilo de template de string do ES6
183183
app.config.compilerOptions.delimiters = ['${', '}']
184184
```
185185

186-
Sets the delimiters used for text interpolation within the template.
186+
Define os delimitadores usados para a interpolação de texto dentro do _template_.
187187

188-
Typically this is used to avoid conflicting with server-side frameworks that also use mustache syntax.
188+
Tipicamente isso é usado para evitar conflitos com frameworks do lado do servidor que também usam sintaxe _mustache_.
189189

190190
### compilerOptions.comments
191191

192-
- **Type:** `boolean`
192+
- **Tipo:** `boolean`
193193

194-
- **Default:** `false`
194+
- **Padrão:** `false`
195195

196-
- **Usage:**
196+
- **Uso:**
197197

198198
```js
199199
app.config.compilerOptions.comments = true
200200
```
201201

202-
By default, Vue will remove HTML comments inside templates in production. Setting this option to `true` will force Vue to preserve comments even in production. Comments are always preserved during development.
202+
Por padrão, o Vue removerá comentários HTML de dentro de _templates_ em produção. Definir esta opção como `true` forçará o Vue a preservar os comentários mesmo em produção. Comentários são sempre preservados em desenvolvimento.
203203

204-
This option is typically used when Vue is used with other libraries that rely on HTML comments.
204+
Esta opção é tipicamente usada quando o Vue é usado com outras bibliotecas que dependem de comentários HTML.
205205

206206
## isCustomElement <Badge text="deprecated" type="warning"/>
207207

208-
Deprecated in 3.1.0. Use [`compilerOptions.isCustomElement`](#compileroptions-iscustomelement) instead.
208+
Descontinuado na versão 3.1.0. Use [`compilerOptions.isCustomElement`](#compileroptions-iscustomelement).

src/api/basic-reactivity.md

+8-8
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,31 @@ A conversão reativa é "profunda" - ela afeta todas as propriedades aninhadas.
1818
function reactive<T extends object>(target: T): UnwrapNestedRefs<T>
1919
```
2020

21-
::: tip Note
22-
`reactive` will unwrap all the deep [refs](./refs-api.html#ref), while maintaining the ref reactivity
21+
::: tip Nota
22+
`reactive` desempacotará profundamente todas as [refs](./refs-api.html#ref), enquanto mantém a reatividade da ref
2323

2424
```ts
2525
const count = ref(1)
2626
const obj = reactive({ count })
2727
28-
// ref will be unwrapped
28+
// A ref será desempacotada
2929
console.log(obj.count === count.value) // true
3030
31-
// it will update `obj.count`
31+
// Isto vai atualizar `obj.count`
3232
count.value++
3333
console.log(count.value) // 2
3434
console.log(obj.count) // 2
3535
36-
// it will also update `count` ref
36+
// Isto também vai atualizar a ref `count`
3737
obj.count++
3838
console.log(obj.count) // 3
3939
console.log(count.value) // 3
4040
```
4141

4242
:::
4343

44-
::: warning Important
45-
When assigning a [ref](./refs-api.html#ref) to a `reactive` property, that ref will be automatically unwrapped.
44+
::: warning Importante
45+
Ao atribuir um [ref](./refs-api.html#ref) a uma propriedade `reactive`, este ref será automaticamente desempacotado.
4646

4747
```ts
4848
const count = ref(1)
@@ -77,7 +77,7 @@ original.count++
7777
copy.count++ // aviso!
7878
```
7979

80-
As with [`reactive`](#reactive), if any property uses a `ref` it will be automatically unwrapped when it is accessed via the proxy:
80+
Assim como acontece com [`reactive`](#reactive), se alguma propriedade usar `ref`, este será automaticamente desempacotado quando for acessado pelo _proxy_:
8181

8282
```js
8383
const raw = {

src/api/built-in-components.md

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
# Componentes Integrados
22

3-
Built-in components can be used directly in templates without needing to be registered.
3+
Os componentes integrados podem ser usados diretamente em _templates_ sem a necessidade de registro.
44

5-
The `<keep-alive>`, `<transition>`, `<transition-group>`, and `<teleport>` components can all be tree-shaken by bundlers, so that they are only included in the build if they're used. They can also be imported explicitly if you need direct access to the component itself:
5+
Os componentes `<keep-alive>`, `<transition>`, `<transition-group>`, e `<teleport>` podem ser todos _tree-shaken_ por empacotadores (_bundlers_), de modo que só são incluídos na construção se forem usados. Eles também podem ser importados explicitamente se você precisar de acesso direto ao próprio componente:
66

77
```js
8-
// CDN build of Vue
8+
// Distribuição em CDN do Vue
99
const { KeepAlive, Teleport, Transition, TransitionGroup } = Vue
1010
```
1111

1212
```js
13-
// ESM build of Vue
13+
// Distribuição em ESM do Vue
1414
import { KeepAlive, Teleport, Transition, TransitionGroup } from 'vue'
1515
```
1616

17-
`<component>` and `<slot>` are component-like features of template syntax. They are not true components and they can't be imported like the components shown above.
17+
`<component>` e `<slot>` são recursos da sintaxe de _template_ em forma de componentes. Eles não são componentes verdadeiros e não podem ser importados como os componentes mostrados acima.
1818

1919
## component
2020

@@ -41,7 +41,7 @@ import { KeepAlive, Teleport, Transition, TransitionGroup } from 'vue'
4141
<component :is="href ? 'a' : 'span'"></component>
4242
```
4343

44-
The built-in components `KeepAlive`, `Transition`, `TransitionGroup`, and `Teleport` can all be passed to `is`, but you must register them if you want to pass them by name. For example:
44+
Os componentes integrados `KeepAlive`, `Transition`, `TransitionGroup`, e `Teleport` podem ser passados para `is`, mas você deve registrá-los se quiser transmiti-los por nome. Por exemplo:
4545

4646
```js
4747
const { Transition, TransitionGroup } = Vue
@@ -60,7 +60,7 @@ import { KeepAlive, Teleport, Transition, TransitionGroup } from 'vue'
6060
}
6161
```
6262

63-
Registration is not required if you pass the component itself to `is` rather than its name.
63+
O registro não será necessário se você passar o próprio componente para `is` ao invés de seu nome.
6464

6565
- **Ver também:** [Componentes Dinâmicos](../guide/component-dynamic-async.html)
6666

0 commit comments

Comments
 (0)