|
146 | 146 |
|
147 | 147 | `v-for` também pode trabalhar em valores que implementam o [Protocolo Iterável](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Iteration_protocols#The_iterable_protocol), incluindo `Map` e `Set` nativos.
|
148 | 148 |
|
149 |
| - O uso detalhado de `v-for` é explicado na seção de Guia com link abaixo. |
| 149 | + O uso detalhado de `v-for` é explicado na seção de Guia com *link* abaixo. |
150 | 150 |
|
151 | 151 | - **Ver também:**
|
152 | 152 | - [Renderização de Listas](../guide/list.html)
|
|
180 | 180 |
|
181 | 181 | Quando escutando a eventos nativos de DOM, o método recebe o evento nativo como argumento único. Quando usada declaração *inline*, ela tem acesso à propriedade especial `$event`: `v-on:click="handle('ok', $event)"`.
|
182 | 182 |
|
183 |
| - `v-on` also supports binding to an object of event/listener pairs without an argument. Note when using the object syntax, it does not support any modifiers. |
| 183 | + `v-on` também oferece suporte à vinculação a um objeto de pares de evento/ouvinte sem um argumento. Observe que ao usar a sintaxe do objeto, ela não oferece suporte a nenhum modificador. |
184 | 184 |
|
185 | 185 | - **Exemplo:**
|
186 | 186 |
|
|
241 | 241 |
|
242 | 242 | - **Espera:** `any (with argument) | Object (without argument)`
|
243 | 243 |
|
244 |
| -- **Argumento:** `attrOrProp (optional)` |
| 244 | +- **Argumento:** `attrOrProp (opcional)` |
245 | 245 |
|
246 | 246 | - **Modificadores:**
|
247 | 247 |
|
248 | 248 | - `.camel` - transforma o nome do atributo de kebab-case para camelCase.
|
249 | 249 |
|
250 | 250 | - **Uso:**
|
251 | 251 |
|
252 |
| - Dynamically bind one or more attributes, or a component prop to an expression. |
| 252 | + Dinamicamente faz a interligação de um ou mais atributos ou propriedades de um componente a uma expressão. |
253 | 253 |
|
254 |
| - When used to bind the `class` or `style` attribute, it supports additional value types such as Array or Objects. See linked guide section below for more details. |
| 254 | + Quando usado para o vínculo de atributos `class` ou `style`, suporta tipos de valores adicionais como Array ou Objects. Veja na seção do Guia abaixo para mais detalhes. |
255 | 255 |
|
256 |
| - When used for prop binding, the prop must be properly declared in the child component. |
| 256 | + Quando usado para vincular uma propriedade, a propriedade deve ser devidamente declarada no elemento-filho. |
257 | 257 |
|
258 |
| - When used without an argument, can be used to bind an object containing attribute name-value pairs. Note in this mode `class` and `style` does not support Array or Objects. |
| 258 | + Quando usado sem argumentos, pode ser utilizado para vincular em um objeto contendo pares nome-valor. Perceba que, neste modo,`class` e `style` não suportam Array ou Objects. |
259 | 259 |
|
260 | 260 | - **Exemplo:**
|
261 | 261 |
|
262 | 262 | ```html
|
263 |
| - <!-- bind an attribute --> |
| 263 | + <!-- interligando a um atributo --> |
264 | 264 | <img v-bind:src="imageSrc" />
|
265 | 265 |
|
266 |
| - <!-- dynamic attribute name --> |
| 266 | + <!-- nome de atributo dinâmico --> |
267 | 267 | <button v-bind:[key]="value"></button>
|
268 | 268 |
|
269 |
| - <!-- shorthand --> |
| 269 | + <!-- forma abreviada --> |
270 | 270 | <img :src="imageSrc" />
|
271 | 271 |
|
272 |
| - <!-- shorthand dynamic attribute name --> |
| 272 | + <!-- forma abreviada do nome de atributo dinâmico --> |
273 | 273 | <button :[key]="value"></button>
|
274 | 274 |
|
275 |
| - <!-- with inline string concatenation --> |
| 275 | + <!-- com concatenação de string inline --> |
276 | 276 | <img :src="'/path/to/images/' + fileName" />
|
277 | 277 |
|
278 |
| - <!-- class binding --> |
| 278 | + <!-- interligando classes --> |
279 | 279 | <div :class="{ red: isRed }"></div>
|
280 | 280 | <div :class="[classA, classB]"></div>
|
281 | 281 | <div :class="[classA, { classB: isB, classC: isC }]">
|
282 |
| - <!-- style binding --> |
| 282 | + |
| 283 | + <!-- interligando estilos --> |
283 | 284 | <div :style="{ fontSize: size + 'px' }"></div>
|
284 | 285 | <div :style="[styleObjectA, styleObjectB]"></div>
|
285 | 286 |
|
286 |
| - <!-- binding an object of attributes --> |
| 287 | + <!-- interligando um objeto com atributos --> |
287 | 288 | <div v-bind="{ id: someProp, 'other-attr': otherProp }"></div>
|
288 | 289 |
|
289 |
| - <!-- prop binding. "prop" must be declared in my-component. --> |
| 290 | + <!-- interligando propriedade. "prop" deve ser declarado em my-component --> |
290 | 291 | <my-component :prop="someThing"></my-component>
|
291 | 292 |
|
292 |
| - <!-- pass down parent props in common with a child component --> |
| 293 | + <!-- transmite todas as props do pai em comum com o componente-filho --> |
293 | 294 | <child-component v-bind="$props"></child-component>
|
294 | 295 |
|
295 | 296 | <!-- XLink -->
|
296 | 297 | <svg><a :xlink:special="foo"></a></svg>
|
| 298 | + |
297 | 299 | </div>
|
298 | 300 | ```
|
299 | 301 |
|
300 |
| - The `.camel` modifier allows camelizing a `v-bind` attribute name when using in-DOM templates, e.g. the SVG `viewBox` attribute: |
| 302 | + O modificador `.camel` permite colocar na notação *camelCase* (*camelizing*) um nome do atributo `v-bind` quando usado em *templates* no DOM, por exemplo, o atributo `viewBox` de um SVG: |
301 | 303 |
|
302 | 304 | ```html
|
303 | 305 | <svg :view-box.camel="viewBox"></svg>
|
304 | 306 | ```
|
305 | 307 |
|
306 |
| - `.camel` is not needed if you are using string templates, or compiling with `vue-loader`/`vueify`. |
| 308 | + `.camel` não é necessário se você está usando *templates* baseados em String ou compilando com `vue-loader`/`vueify`. |
307 | 309 |
|
308 | 310 | - **Ver também:**
|
309 |
| - - [Class and Style Bindings](../guide/class-and-style.html) |
310 |
| - - [Components - Props](../guide/component-basics.html#passing-data-to-child-components-with-props) |
| 311 | + - [Interligações em Classes e Estilos](../guide/class-and-style.html) |
| 312 | + - [Componentes - Propriedades](../guide/component-basics.html#passing-data-to-child-components-with-props) |
311 | 313 |
|
312 | 314 | ## v-model
|
313 | 315 |
|
314 |
| -- **Espera:** varies based on value of form inputs element or output of components |
| 316 | +- **Espera:** varia baseado no valor do elemento de input de formulário ou saída de componentes |
315 | 317 |
|
316 | 318 | - **Limitado a:**
|
317 | 319 |
|
318 | 320 | - `<input>`
|
319 | 321 | - `<select>`
|
320 | 322 | - `<textarea>`
|
321 |
| - - components |
| 323 | + - componentes |
322 | 324 |
|
323 | 325 | - **Modificadores:**
|
324 | 326 |
|
325 |
| - - [`.lazy`](../guide/forms.html#lazy) - listen to `change` events instead of `input` |
326 |
| - - [`.number`](../guide/forms.html#number) - cast valid input string to numbers |
327 |
| - - [`.trim`](../guide/forms.html#trim) - trim input |
| 327 | + - [`.lazy`](../guide/forms.html#lazy) - escuta por eventos `change` ao invés de `input` |
| 328 | + - [`.number`](../guide/forms.html#number) - faz a conversão da String informada para números |
| 329 | + - [`.trim`](../guide/forms.html#trim) - faz trim dos dados informados |
328 | 330 |
|
329 | 331 | - **Uso:**
|
330 | 332 |
|
331 |
| - Create a two-way binding on a form input element or a component. For detailed usage and other notes, see the Guide section linked below. |
| 333 | + Cria uma interligação de mão dupla (*two-way binding*) em um elemento de entrada (*input*) de formulário ou componente. Para uso detalhado e outras observações, veja o *link* abaixo para a seção do Guia. |
332 | 334 |
|
333 | 335 | - **Ver também:**
|
334 |
| - - [Form Input Bindings](../guide/forms.html) |
335 |
| - - [Components - Form Input Components using Custom Events](../guide/component-custom-events.html#v-model-arguments) |
| 336 | + - [Interligações em Formulários](../guide/forms.html) |
| 337 | + - [Componentes - Componentes de Formulários usando Eventos Personalizados](../guide/component-custom-events.html#v-model-arguments) |
336 | 338 |
|
337 | 339 | ## v-slot
|
338 | 340 |
|
339 | 341 | - **Forma abreviada:** `#`
|
340 | 342 |
|
341 |
| -- **Espera:** JavaScript expression that is valid in a function argument position (supports destructuring in [supported environments](../guide/component-slots.html#destructuring-slot-props)). Optional - only needed if expecting props to be passed to the slot. |
| 343 | +- **Espera:** expressão JavaScript que seja válida na posição de um argumento de função (aceita desestruturação em [ambientes suportados](../guide/component-slots.html#destructuring-slot-props)). Opcional - somente necessário se estiver esperando que propriedades sejam passadas ao *slot*. |
342 | 344 |
|
343 |
| -- **Argumento:** slot name (optional, defaults to `default`) |
| 345 | +- **Argumento:** nome de *slot* (opcional, o valor padrão é `default`) |
344 | 346 |
|
345 | 347 | - **Limitado a:**
|
346 | 348 |
|
347 | 349 | - `<template>`
|
348 |
| - - [components](../guide/component-slots.html#abbreviated-syntax-for-lone-default-slots) (for a lone default slot with props) |
| 350 | + - [componentes](../guide/component-slots.html#abbreviated-syntax-for-lone-default-slots) (para um único *slot* padrão com propriedades) |
349 | 351 |
|
350 | 352 | - **Uso:**
|
351 | 353 |
|
352 |
| - Denote named slots or slots that expect to receive props. |
| 354 | + Denotar *slots* ou *slots* nomeados que esperam receber propriedades. |
353 | 355 |
|
354 | 356 | - **Exemplo:**
|
355 | 357 |
|
356 | 358 | ```html
|
357 |
| - <!-- Named slots --> |
| 359 | + <!-- Slots nomeados --> |
358 | 360 | <base-layout>
|
359 | 361 | <template v-slot:header>
|
360 | 362 | Header content
|
|
369 | 371 | </template>
|
370 | 372 | </base-layout>
|
371 | 373 |
|
372 |
| - <!-- Named slot that receives props --> |
| 374 | + <!-- Slot nomeado que recebe propriedades --> |
373 | 375 | <infinite-scroll>
|
374 | 376 | <template v-slot:item="slotProps">
|
375 | 377 | <div class="item">
|
|
378 | 380 | </template>
|
379 | 381 | </infinite-scroll>
|
380 | 382 |
|
381 |
| - <!-- Default slot that receive props, with destructuring --> |
| 383 | + <!-- Slot padrão que recebe propriedades, com desestruturação --> |
382 | 384 | <mouse-position v-slot="{ x, y }">
|
383 | 385 | Mouse position: {{ x }}, {{ y }}
|
384 | 386 | </mouse-position>
|
385 | 387 | ```
|
386 | 388 |
|
387 |
| - For more details, see the links below. |
| 389 | + Para mais detalhes, veja os *links* abaixo. |
388 | 390 |
|
389 | 391 | - **Ver também:**
|
390 | 392 | - [Components - Slots](../guide/component-slots.html)
|
|
395 | 397 |
|
396 | 398 | - **Uso:**
|
397 | 399 |
|
398 |
| - Skip compilation for this element and all its children. You can use this for displaying raw mustache tags. Skipping large numbers of nodes with no directives on them can also speed up compilation. |
| 400 | + Pula a compilação para esse elemento e todos seus filhos. Você pode usar isso para mostrar tags mustache sem conversão (*raw*). Pular uma grande quantidade de nós sem diretivas pode acelerar a compilação. |
399 | 401 |
|
400 | 402 | - **Exemplo:**
|
401 | 403 |
|
402 | 404 | ```html
|
403 |
| - <span v-pre>{{ this will not be compiled }}</span> |
| 405 | + <span v-pre>{{ isso não será compilado }}</span> |
404 | 406 | ```
|
405 | 407 |
|
406 | 408 | ## v-cloak
|
|
409 | 411 |
|
410 | 412 | - **Uso:**
|
411 | 413 |
|
412 |
| - This directive will remain on the element until the associated component instance finishes compilation. Combined with CSS rules such as `[v-cloak] { display: none }`, this directive can be used to hide un-compiled mustache bindings until the component instance is ready. |
| 414 | + Essa diretiva permanecerá no elemento até que a instância associada de Vue termine de compilar. Ao ser combinada com regras CSS como `[v-cloak] { display: none }`, essa diretiva pode ser usada para esconder interligações mustache não-compiladas até que a instância de Vue esteja pronta. |
413 | 415 |
|
414 | 416 | - **Exemplo:**
|
415 | 417 |
|
|
425 | 427 | </div>
|
426 | 428 | ```
|
427 | 429 |
|
428 |
| - The `<div>` will not be visible until the compilation is done. |
| 430 | + A `<div>` não ficará visível até que a compilação tenha terminado. |
429 | 431 |
|
430 | 432 | ## v-once
|
431 | 433 |
|
432 | 434 | - **Não espera expressão**
|
433 | 435 |
|
434 | 436 | - **Detalhes:**
|
435 | 437 |
|
436 |
| - Render the element and component **once** only. On subsequent re-renders, the element/component and all its children will be treated as static content and skipped. This can be used to optimize update performance. |
| 438 | + Renderiza o elemento e componente **apenas uma vez**. Em re-renderizações subsequentes, o elemento/componente e todos seus filhos serão tratados como conteúdo estático e pulados. Isso pode ser usado para otimizar o desempenho da atualização. |
437 | 439 |
|
438 | 440 | ```html
|
439 |
| - <!-- single element --> |
440 |
| - <span v-once>This will never change: {{msg}}</span> |
441 |
| - <!-- the element have children --> |
| 441 | + <!-- elemento único --> |
| 442 | + <span v-once>Isso nunca vai mudar: {{msg}}</span> |
| 443 | + <!-- o elemento tem filhos --> |
442 | 444 | <div v-once>
|
443 |
| - <h1>comment</h1> |
| 445 | + <h1>comentário</h1> |
444 | 446 | <p>{{msg}}</p>
|
445 | 447 | </div>
|
446 |
| - <!-- component --> |
| 448 | + <!-- componente --> |
447 | 449 | <my-component v-once :comment="msg"></my-component>
|
448 |
| - <!-- `v-for` directive --> |
| 450 | + <!-- diretiva `v-for` --> |
449 | 451 | <ul>
|
450 | 452 | <li v-for="i in list" v-once>{{i}}</li>
|
451 | 453 | </ul>
|
452 | 454 | ```
|
453 | 455 |
|
454 | 456 | - **Ver também:**
|
455 |
| - - [Data Binding Syntax - interpolations](../guide/template-syntax.html#text) |
| 457 | + - [Sintaxe de Templates - Interpolações](../guide/template-syntax.html#text) |
456 | 458 |
|
457 | 459 | ## v-is
|
458 | 460 |
|
459 |
| -> Note: this section only affects cases where Vue templates are directly written in the page's HTML. |
| 461 | +> Note: esta seção afeta apenas os casos em que os *templates* Vue são escritos diretamente no HTML da página. |
460 | 462 |
|
461 | 463 | - **Espera:** string literal
|
462 | 464 |
|
463 |
| -- **Limitado a:** native HTML elements |
| 465 | +- **Limitado a:** elementos HTML nativos |
464 | 466 |
|
465 |
| -- **Uso:** When using in-DOM templates, the template is subject to native HTML parsing rules. Some HTML elements, such as `<ul>`, `<ol>`, `<table>` and `<select>` have restrictions on what elements can appear inside them, and some elements such as `<li>`, `<tr>`, and `<option>` can only appear inside certain other elements. As a workaround, we can use `v-is` directive on these elements: |
| 467 | +- **Uso:** Ao usar modelos no DOM, o modelo está sujeito às regras de análise de HTML nativo. Alguns elementos HTML, como `<ul>`, `<ol>`, `<table>` e `<select>` têm restrições sobre quais elementos podem aparecer dentro deles, e alguns elementos como `<li>`, `<tr>`, e `<option>` só podem aparecer dentro de alguns determinados elementos. Como solução alternativa, podemos usar a diretiva `v-is` nestes elementos: |
466 | 468 |
|
467 | 469 | ```html
|
468 | 470 | <table>
|
|
471 | 473 | ```
|
472 | 474 |
|
473 | 475 | :::warning
|
474 |
| -`v-is` functions like a dynamic 2.x `:is` binding - so to render a component by its registered name, its value should be a JavaScript string literal: |
| 476 | +`v-is` funciona como uma ligação dinâmica 2.x `:is` - então, para renderizar um componente por seu nome registrado, seu valor deve ser um string literal de JavaScript: |
475 | 477 |
|
476 | 478 | ```html
|
477 |
| -<!-- Incorrect, nothing will be rendered --> |
| 479 | +<!-- Incorreto, nada será renderizado --> |
478 | 480 | <tr v-is="blog-post-row"></tr>
|
479 | 481 |
|
480 |
| -<!-- Correct --> |
| 482 | +<!-- Correto --> |
481 | 483 | <tr v-is="'blog-post-row'"></tr>
|
482 | 484 | ```
|
483 | 485 |
|
|
0 commit comments