Skip to content

Commit 58ca336

Browse files
committed
Docs: Begin translating render-function-api to PT-BR
1 parent d4eaf6e commit 58ca336

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

src/guide/migration/render-function-api.md

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -3,41 +3,43 @@ badges:
33
- breaking
44
---
55

6-
# Render Function API <MigrationBadges :badges="$frontmatter.badges" />
6+
# API da Função de Renderização <MigrationBadges :badges="$frontmatter.badges" />
77

8-
## Overview
8+
## Visão Geral
99

10-
This change will not affect `<template>` users.
10+
Esta mudança não vai afetar usuários de `<template>`.
1111

12-
Here is a quick summary of what has changed:
12+
Aqui está um rápido resumo do que mudou:
1313

14-
- `h` is now globally imported instead of passed to render functions as an arguments
15-
- render function arguments changed to be more consistent between stateful and functional components
16-
- VNodes now have a flat props structure
14+
- `h` agora é globalmente importado em vez de passado como argumento para funções de renderização
15+
- Argumentos da função render mudaram para ser mais consistentes entre componentes funcionais e com estado
16+
- VNodes agora têm uma estrutura plana de props
1717

18-
For more information, read on!
1918

20-
## Render Function Argument
19+
Para mais informações, continue lendo!
2120

22-
### 2.x Syntax
21+
## Argumento da Função Render
22+
23+
### Sintaxe 2.x
2324

24-
In 2.x, the `render` function would automatically receive the `h` function (which is a conventional alias for `createElement`) as an argument:
25+
Na versão 2.x, a função `render` receberia automaticamente a função `h` (que é um _alias_ para `createElement`) como argumento:
2526

2627
```js
27-
// Vue 2 Render Function Example
28+
// Exemplo da Função Render no Vue 2
2829
export default {
2930
render(h) {
3031
return h('div')
3132
}
3233
}
3334
```
3435

35-
### 3.x Syntax
36+
### Sintaxe 3.x
37+
38+
Na versão 3.x, o `h` agora é importado globalmente em vez de automaticamente passado como um argumento.
3639

37-
In 3.x, `h` is now globally imported instead of being automatically passed as an argument.
3840

3941
```js
40-
// Vue 3 Render Function Example
42+
// Exemplo da Função Render no Vue 3
4143
import { h } from 'vue'
4244

4345
export default {
@@ -46,25 +48,24 @@ export default {
4648
}
4749
}
4850
```
51+
## Mudança da assinatura da função Render
4952

50-
## Render Function Signature Change
53+
### Sintaxe 2.x
5154

52-
### 2.x Syntax
53-
54-
In 2.x, the `render` function automatically received arguments such as `h`.
55+
Na versão 2.x, a função `render` recebeu automaticamente argumentos como o `h`.
5556

5657
```js
57-
// Vue 2 Render Function Example
58+
// Exemplo da Função Render no Vue 2
5859
export default {
5960
render(h) {
6061
return h('div')
6162
}
6263
}
6364
```
65+
### Sintaxe 3.x
6466

65-
### 3.x Syntax
67+
Na versão 3.x, desde que a função `render` já não recebe argumentos, ela será primeiramente usada dentro da função `setup()`. Isso traz o benefício adicional em ganhar acesso para o estado reativo e às funções declaradas no escopo, assim como argumentos passados para o `setup()`.
6668

67-
In 3.x, since the `render` function no longer receives any arguments, it will primarily be used inside of the `setup()` function. This has the added benefit of gaining access to reactive state and functions declared in scope, as well as the arguments passed to `setup()`.
6869

6970
```js
7071
import { h, reactive } from 'vue'
@@ -79,7 +80,7 @@ export default {
7980
state.count++
8081
}
8182

82-
// return the render function
83+
// retorna a função render
8384
return () =>
8485
h(
8586
'div',
@@ -91,14 +92,13 @@ export default {
9192
}
9293
}
9394
```
95+
Para mais informações em como o `setup()` funciona, veja nosso [Guia da API de Composição](/guide/composition-api-introduction.html).
9496

95-
For more information on how `setup()` works, see our [Composition API Guide](/guide/composition-api-introduction.html).
97+
## Formato de Props VNode
9698

97-
## VNode Props Format
98-
99-
### 2.x Syntax
99+
### Sintaxe 2.x
100100

101-
In 2.x, `domProps` contained a nested list within the VNode props:
101+
Na versão 2.x, o `domProps` continha uma lista aninhada dentro dos props VNode:
102102

103103
```js
104104
// 2.x

0 commit comments

Comments
 (0)