Skip to content

Commit 7ca0b09

Browse files
authored
Merge pull request #155 from Gabrielr2508/translations/guides/teleport
docs: Translates guides/teleport to pt_BR
2 parents 12a837c + 976a240 commit 7ca0b09

File tree

1 file changed

+30
-30
lines changed

1 file changed

+30
-30
lines changed

src/guide/teleport.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,44 @@
1-
# Teleport
1+
# Teleporte
22

3-
<div class="vueschool"><a href="https://vueschool.io/lessons/vue-3-teleport?friend=vuejs" target="_blank" rel="sponsored noopener" title="Learn how to use teleport with Vue School">Learn how to use teleport with a free lesson on Vue School</a></div>
3+
<div class="vueschool"><a href="https://vueschool.io/lessons/vue-3-teleport?friend=vuejs" target="_blank" rel="sponsored noopener" title="Aprenda a usar o teleport com Vue School">Aprenda como usar o teleporte em uma aula grátis do Vue School</a></div>
44

5-
Vue encourages us to build our UIs by encapsulating UI and related behavior into components. We can nest them inside one another to build a tree that makes up an application UI.
5+
O Vue nos encoraja à construir nossas interfaces de usuário (UIs) encapsulando a UI e seu respectivo comportamento em componentes. Podemos aninhar componentes dentro de outros componentes e montar uma árvore que constitui a UI da aplicação.
66

7-
However, sometimes a part of a component's template belongs to this component logically, while from a technical point of view, it would be preferable to move this part of the template somewhere else in the DOM, outside of the Vue app.
7+
Entretanto, algumas vezes uma parte do _template_ do componente pertence à esse componente de forma lógica, enquanto do ponto de vista técnico, seria preferível mover essa parte do _template_ para outro lugar no DOM, fora da aplicação Vue.
88

9-
A common scenario for this is creating a component that includes a full-screen modal. In most cases, you'd want the modal's logic to live within the component, but the positioning of the modal quickly becomes difficult to solve through CSS, or requires a change in component composition.
9+
Um cenário comum para isso é a criação de um componente que inclui um _modal_ em tela cheia. Na maioria dos casos, você gostaria que a lógica do modal residisse dentro do componente, mas o posicionamento do modal se torna difícil de resolver por meio de CSS ou requer uma mudança na composição do componente.
1010

11-
Consider the following HTML structure.
11+
Considere a seguinte estrutura HTML.
1212

1313
```html
1414
<body>
1515
<div style="position: relative;">
16-
<h3>Tooltips with Vue 3 Teleport</h3>
16+
<h3>Tooltips com Vue 3 e Teleport</h3>
1717
<div>
1818
<modal-button></modal-button>
1919
</div>
2020
</div>
2121
</body>
2222
```
2323

24-
Let's take a look at `modal-button`.
24+
Vamos olhar o `modal-button` de perto.
2525

26-
The component will have a `button` element to trigger the opening of the modal, and a `div` element with a class of `.modal`, which will contain the modal's content and a button to self-close.
26+
O componente terá um elemento `button` para acionar a abertura do modal e um elemento `div` com uma classe `.modal` que irá conter o conteúdo do modal e um botão para fechá-lo.
2727

2828
```js
2929
const app = Vue.createApp({});
3030

3131
app.component('modal-button', {
3232
template: `
3333
<button @click="modalOpen = true">
34-
Open full screen modal!
34+
Abrir modal de tela cheia!
3535
</button>
3636
3737
<div v-if="modalOpen" class="modal">
3838
<div>
39-
I'm a modal!
39+
Eu sou um modal!
4040
<button @click="modalOpen = false">
41-
Close
41+
Fechar
4242
</button>
4343
</div>
4444
</div>
@@ -51,26 +51,26 @@ app.component('modal-button', {
5151
})
5252
```
5353

54-
When using this component inside the initial HTML structure, we can see a problem - the modal is being rendered inside the deeply nested `div` and the `position: absolute` of the modal takes the parent relatively positioned `div` as reference.
54+
Ao usar esse componente dentro da estrutura HTML inicial, podemos ver um problema - o modal está sendo renderizado dentro de uma `div` profundamente aninhada e a `position: absolute` do modal toma como referência a `div` pai posicionada relativamente.
5555

56-
Teleport provides a clean way to allow us to control under which parent in our DOM we want a piece of HTML to be rendered, without having to resort to global state or splitting this into two components.
56+
O Teleporte fornece uma maneira limpa para nos permitir controlar sob que elemento pai no DOM nós queremos que uma parte do HTML seja rederizada, sem ter que recorrer ao estado global ou dividí-lo em dois componentes.
5757

58-
Let's modify our `modal-button` to use `<teleport>` and tell Vue "**teleport** this HTML **to** the "**body**" tag".
58+
Vamos modificar nosso `modal-button` para usar o `<teleport>` e dizer ao Vue que "**teleporte** esse HTML **para** a _tag_ '**body**'".
5959

6060
```js
6161
app.component('modal-button', {
6262
template: `
6363
<button @click="modalOpen = true">
64-
Open full screen modal! (With teleport!)
64+
Abrir modal de tela cheia! (Com Teleporte!)
6565
</button>
6666
6767
<teleport to="body">
6868
<div v-if="modalOpen" class="modal">
6969
<div>
70-
I'm a teleported modal!
71-
(My parent is "body")
70+
Eu sou um modal teleportado!
71+
(Meu pai é o "body")
7272
<button @click="modalOpen = false">
73-
Close
73+
Fechar
7474
</button>
7575
</div>
7676
</div>
@@ -84,7 +84,7 @@ app.component('modal-button', {
8484
})
8585
```
8686

87-
As a result, once we click the button to open the modal, Vue will correctly render the modal's content as a child of the `body` tag.
87+
Como resultado, uma vez que clicamos no botão para abrir o modal, o Vue irá renderizar corretamente o conteúdo como um filho da _tag_ `body`.
8888

8989
<p class="codepen" data-height="300" data-theme-id="39028" data-default-tab="js,result" data-user="Vue" data-slug-hash="gOPNvjR" data-preview="true" data-editable="true" style="height: 300px; box-sizing: border-box; display: flex; align-items: center; justify-content: center; border: 2px solid; margin: 1em 0; padding: 1em;" data-pen-title="Vue 3 Teleport">
9090
<span>See the Pen <a href="https://codepen.io/team/Vue/pen/gOPNvjR">
@@ -93,21 +93,21 @@ As a result, once we click the button to open the modal, Vue will correctly rend
9393
</p>
9494
<script async src="https://static.codepen.io/assets/embed/ei.js"></script>
9595

96-
## Using with Vue components
96+
## Usando com Componentes Vue
9797

98-
If `<teleport>` contains a Vue component, it will remain a logical child component of the `<teleport>`'s parent:
98+
Se o `<teleport>` contém um componente Vue, o componente permanecerá um filho lógico do pai do `<teleport>`:
9999

100100
```js
101101
const app = Vue.createApp({
102102
template: `
103-
<h1>Root instance</h1>
103+
<h1>Instância raiz</h1>
104104
<parent-component />
105105
`
106106
})
107107

108108
app.component('parent-component', {
109109
template: `
110-
<h2>This is a parent component</h2>
110+
<h2>Este é um componente pai</h2>
111111
<teleport to="#endofbody">
112112
<child-component name="John" />
113113
</teleport>
@@ -117,18 +117,18 @@ app.component('parent-component', {
117117
app.component('child-component', {
118118
props: ['name'],
119119
template: `
120-
<div>Hello, {{ name }}</div>
120+
<div>Olá, {{ name }}</div>
121121
`
122122
})
123123
```
124124

125-
In this case, even when `child-component` is rendered in the different place, it will remain a child of `parent-component` and will receive a `name` prop from it.
125+
Neste caso, mesmo quando o `child-component` é renderizado em um lugar diferente, permanecerá como filho do `parent-component` e receberá a propriedade `name` dele.
126126

127-
This also means that injections from a parent component work as expected, and that the child component will be nested below the parent component in the Vue Devtools, instead of being placed where the actual content moved to.
127+
Isso também significa que injeções vindas do componente pai funcionam como o esperado, e que o componente filho será aninhado embaixo do componente pai no _Vue Devtools_, em vez de ser colocado no lugar para o qual o conteúdo foi movido.
128128

129-
## Using multiple teleports on the same target
129+
## Usando Múltiplos Teleportes no Mesmo Alvo
130130

131-
A common use case scenario would be a reusable `<Modal>` component of which there might be multiple instances active at the same time. For this kind of scenario, multiple `<teleport>` components can mount their content to the same target element. The order will be a simple append - later mounts will be located after earlier ones within the target element.
131+
Um cenário de caso de uso comum pode ser um componente `<Modal>` reutilizável, do qual pode haver várias instâncias ativas ao mesmo tempo. Para esse tipo de cenário, múltiplos componentes `<teleport>` podem montar seus respectivos conteúdos no mesmo elemento alvo. A ordem será simplemente anexá-los - as montagens novas serão localizadas depois das primeiras montagens realizadas no elemento alvo.
132132

133133
```html
134134
<teleport to="#modals">
@@ -145,4 +145,4 @@ A common use case scenario would be a reusable `<Modal>` component of which ther
145145
</div>
146146
```
147147

148-
You can check `<teleport>` component options in the [API reference](../api/built-in-components.html#teleport)
148+
Você pode checar as opções do componente `<teleport>` nas [referências da API](../api/built-in-components.html#teleport)

0 commit comments

Comments
 (0)