@@ -3,63 +3,63 @@ badges:
3
3
- breaking
4
4
---
5
5
6
- # Slots Unification <MigrationBadges :badges =" $frontmatter.badges " />
6
+ # Unificação de Slots <MigrationBadges :badges =" $frontmatter.badges " />
7
7
8
- ## Overview
8
+ ## Visão Geral
9
9
10
- This change unifies normal and scoped slots in 3 .x.
10
+ Esta modificação unifica _ slots _ normais e _ slots _ com escopo na v3 .x.
11
11
12
- Here is a quick summary of what has changed :
12
+ Aqui um pequeno sumário sobre o que mudou :
13
13
14
- - ` this.$slots ` now exposes slots as functions
15
- - ** BREAKING ** : ` this.$scopedSlots ` is removed
14
+ - ` this.$slots ` agora exibe os _ slots _ como funções
15
+ - ** QUEBRA ** : ` this.$scopedSlots ` foi removido
16
16
17
- For more information, read on !
17
+ Para mais informações, continue lendo !
18
18
19
- ## 2.x Syntax
19
+ ## Sintaxe v2.x
20
20
21
- When using the render function, i.e., ` h ` , 2 .x used to define the ` slot ` data property on the content nodes .
21
+ Ao utilizar uma função de renderização, como ` h ` , a v2 .x definia a propriedade ` slot ` nos nós do conteúdo .
22
22
23
23
``` js
24
- // 2.x Syntax
24
+ // Sintaxe v2.x
25
25
h (LayoutComponent, [
26
26
h (' div' , { slot: ' header' }, this .header ),
27
27
h (' div' , { slot: ' content' }, this .content )
28
28
])
29
29
```
30
30
31
- In addition, when referencing scoped slots, they could be referenced using the following syntax :
31
+ Além disso, ao referenciar _ slots _ com escopo definido, eles poderiam ser referenciados usando a seguinte sintaxe :
32
32
33
33
``` js
34
- // 2.x Syntax
34
+ // Sintaxe v2.x
35
35
this .$scopedSlots .header
36
36
```
37
37
38
- ## 3.x Syntax
38
+ ## Sintaxe v3.x
39
39
40
- In 3 .x, slots are defined as children of the current node as an object :
40
+ Na v3 .x, os _ slots _ são definidos como um objeto, filhos do nó atual :
41
41
42
42
``` js
43
- // 3.x Syntax
43
+ // Sintaxe v3.x
44
44
h (LayoutComponent, {}, {
45
45
header : () => h (' div' , this .header ),
46
46
content : () => h (' div' , this .content )
47
47
})
48
48
```
49
49
50
- And when you need to reference scoped slots programmatically, they are now unified into the ` $slots ` option .
50
+ E quando você precisar referenciar _ slots _ com escopo programaticamente, estes agora estão unificados na opção ` $slots ` .
51
51
52
52
``` js
53
- // 2.x Syntax
53
+ // Sintaxe v2.x
54
54
this .$scopedSlots .header
55
55
56
- // 3.x Syntax
56
+ // Sintaxe v3.x
57
57
this .$slots .header ()
58
58
```
59
59
60
- ## Migration Strategy
60
+ ## Estratégia de Migração
61
61
62
- A majority of the change has already been shipped in 2.6. As a result, the migration can happen in one step :
62
+ A maioria das alterações já estão presentes na versão 2.6. Desta forma, a migração pode acontecer em uma etapa :
63
63
64
- 1 . Replace all ` this.$scopedSlots ` occurrences with ` this.$slots ` in 3 .x.
65
- 2 . Replace all occurrences of ` this.$slots.mySlot ` with ` this.$slots.mySlot() `
64
+ 1 . Susbstitua todas as ocorrências de ` this.$scopedSlots ` por ` this.$slots ` na v3 .x.
65
+ 2 . Susbstitua todas as ocorrências de ` this.$slots.mySlot ` por ` this.$slots.mySlot() ` .
0 commit comments