|
1 |
| -# Instance Properties |
| 1 | +# Propriedades de Instância |
2 | 2 |
|
3 | 3 | ## $data
|
4 | 4 |
|
5 |
| -- **Type:** `Object` |
| 5 | +- **Tipo:** `Object` |
6 | 6 |
|
7 |
| -- **Details:** |
| 7 | +- **Detalhes:** |
8 | 8 |
|
9 |
| - The data object that the component instance is observing. The component instance proxies access to the properties on its data object. |
| 9 | + O objeto de dados que a instância do componente está observando. As proxies da instância do componente acessam as propriedades deste objeto de dados. |
10 | 10 |
|
11 |
| -- **See also:** [Options / Data - data](./options-data.html#data-2) |
| 11 | +- **Ver também:** [Opções - Dados](./options-data.html#data-2) |
12 | 12 |
|
13 | 13 | ## $props
|
14 | 14 |
|
15 |
| -- **Type:** `Object` |
| 15 | +- **Tipo:** `Object` |
16 | 16 |
|
17 |
| -- **Details:** |
| 17 | +- **Detalhes:** |
18 | 18 |
|
19 |
| - An object representing the current props a component has received. The component instance proxies access to the properties on its props object. |
| 19 | + Um objeto representando a propriedade atual que o componente recebeu. As proxies de instância do componente acessam as propriedades em seu objeto de propriedades. |
20 | 20 |
|
21 | 21 | ## $el
|
22 | 22 |
|
23 |
| -- **Type:** `any` |
| 23 | +- **Tipo:** `any` |
24 | 24 |
|
25 |
| -- **Read only** |
| 25 | +- **Somente leitura** |
26 | 26 |
|
27 |
| -- **Details:** |
| 27 | +- **Detalhes:** |
28 | 28 |
|
29 |
| - The root DOM element that the component instance is managing. |
| 29 | + O elemento raiz do DOM que a instância do componente está gerenciando. |
30 | 30 |
|
31 | 31 | ## $options
|
32 | 32 |
|
33 |
| -- **Type:** `Object` |
| 33 | +- **Tipo:** `Object` |
34 | 34 |
|
35 |
| -- **Read only** |
| 35 | +- **Somente leitura** |
36 | 36 |
|
37 |
| -- **Details:** |
| 37 | +- **Detalhes:** |
38 | 38 |
|
39 |
| - The instantiation options used for the current component instance. This is useful when you want to include custom properties in the options: |
| 39 | + As opções utilizadas pela atual instância do componente. Isto é útil quando você queira incluir propriedades customizadas nas opções: |
40 | 40 |
|
41 | 41 | ```js
|
42 | 42 | const app = Vue.createApp({
|
|
49 | 49 |
|
50 | 50 | ## $parent
|
51 | 51 |
|
52 |
| -- **Type:** `Component instance` |
| 52 | +- **Tipo:** `Component instance` |
53 | 53 |
|
54 |
| -- **Read only** |
| 54 | +- **Somente leitura** |
55 | 55 |
|
56 |
| -- **Details:** |
| 56 | +- **Detalhes:** |
57 | 57 |
|
58 |
| - The parent instance, if the current instance has one. |
| 58 | + A instância mãe, caso a instância atual possua uma. |
59 | 59 |
|
60 | 60 | ## $root
|
61 | 61 |
|
62 |
| -- **Type:** `Component instance` |
| 62 | +- **Tipo:** `Component instance` |
63 | 63 |
|
64 |
| -- **Read only** |
| 64 | +- **Somente leitura** |
65 | 65 |
|
66 |
| -- **Details:** |
| 66 | +- **Detalhes:** |
67 | 67 |
|
68 |
| - The root component instance of the current component tree. If the current instance has no parents this value will be itself. |
| 68 | + A instância do componente raiz da árvore de componentes. Caso a instância atual não tenha pais, este valor será ele mesmo. |
69 | 69 |
|
70 | 70 | ## $slots
|
71 | 71 |
|
72 |
| -- **Type:** `{ [name: string]: (...args: any[]) => Array<VNode> | undefined }` |
| 72 | +- **Tipo:** `{ [name: string]: (...args: any[]) => Array<VNode> | undefined }` |
73 | 73 |
|
74 |
| -- **Read only** |
| 74 | +- **Somente Leitura** |
75 | 75 |
|
76 |
| -- **Details:** |
| 76 | +- **Detalhes:** |
77 | 77 |
|
78 |
| - Used to programmatically access content [distributed by slots](../guide/component-basics.html#content-distribution-with-slots). Each [named slot](../guide/component-slots.html#named-slots) has its own corresponding property (e.g. the contents of `v-slot:foo` will be found at `this.$slots.foo()`). The `default` property contains either nodes not included in a named slot or contents of `v-slot:default`. |
| 78 | + Usado para o acesso de conteúdo [distribuído com slots](../guide/component-basics.html#content-distribution-with-slots) de forma programática. Cada [slot nomeado](../guide/component-slots.html#slots-nomeados) tem sua propriedade correspondente (e.g. o conteúdo de `v-slot:foo` será encontrado em `this.$slots.foo()`). A propriedade `default` contém os demais nós não incluídos nos slots nomeados ou conteúdos do `v-slot:default`. |
79 | 79 |
|
80 |
| - Accessing `this.$slots` is most useful when writing a component with a [render function](../guide/render-function.html). |
| 80 | + Acessar `this.$slots` é mais útil quando construir um componente com uma [função de renderização](../guide/render-function.html). |
81 | 81 |
|
82 |
| -- **Example:** |
| 82 | +- **Exemplo:** |
83 | 83 |
|
84 | 84 | ```html
|
85 | 85 | <blog-post>
|
86 | 86 | <template v-slot:header>
|
87 |
| - <h1>About Me</h1> |
| 87 | + <h1>Sobre</h1> |
88 | 88 | </template>
|
89 | 89 |
|
90 | 90 | <template v-slot:default>
|
91 | 91 | <p>
|
92 |
| - Here's some page content, which will be included in $slots.default. |
| 92 | + Aqui está o conteúdo da página, que será incluído em $slots.default. |
93 | 93 | </p>
|
94 | 94 | </template>
|
95 | 95 |
|
|
113 | 113 | })
|
114 | 114 | ```
|
115 | 115 |
|
116 |
| -- **See also:** |
117 |
| - - [`<slot>` Component](built-in-components.html#slot) |
118 |
| - - [Content Distribution with Slots](../guide/component-basics.html#content-distribution-with-slots) |
119 |
| - - [Render Functions - Slots](../guide/render-function.html#slots) |
| 116 | +- **Ver também:** |
| 117 | + - [Componente `<slot>`](built-in-components.html#slot) |
| 118 | + - [Distribuição de Conteúdo com Slots](../guide/component-basics.html#distribuição-de-conteúdo-com-slots) |
| 119 | + - [Funções de Renderização - Slots](../guide/render-function.html#slots) |
120 | 120 |
|
121 | 121 | ## $refs
|
122 | 122 |
|
123 |
| -- **Type:** `Object` |
| 123 | +- **Tipo:** `Object` |
124 | 124 |
|
125 |
| -- **Read only** |
| 125 | +- **Somente leitura** |
126 | 126 |
|
127 |
| -- **Details:** |
| 127 | +- **Detalhes:** |
128 | 128 |
|
129 |
| -An object of DOM elements and component instances, registered with [`ref` attributes](../guide/component-template-refs.html). |
| 129 | + Um objeto dos elementos do DOM e as instâncias de componente, registrados com [atributos `ref`](../guide/component-template-refs.html) |
130 | 130 |
|
131 | 131 | - **See also:**
|
132 |
| - - [Template refs](../guide/component-template-refs.html) |
133 |
| - - [Special Attributes - ref](./special-attributes.md#ref) |
| 132 | + - [_refs_ de Template ](../guide/component-template-refs.html) |
| 133 | + - [Atributos especiais - ref](./special-attributes.md#ref) |
134 | 134 |
|
135 | 135 | ## $attrs
|
136 | 136 |
|
137 |
| -- **Type:** `Object` |
| 137 | +- **Tipo:** `Object` |
138 | 138 |
|
139 |
| -- **Read only** |
| 139 | +- **Somente leitura** |
140 | 140 |
|
141 |
| -- **Details:** |
| 141 | +- **Detalhes:** |
142 | 142 |
|
143 |
| -Contains parent-scope attribute bindings and events that are not recognized (and extracted) as component [props](./options-data.html#props) or [custom events](./options-data.html#emits). When a component doesn't have any declared props or custom events, this essentially contains all parent-scope bindings, and can be passed down to an inner component via `v-bind="$attrs"` - useful when creating higher-order components. |
| 143 | +Contêm o atributo de escopo-pai e eventos que não são reconhecidos (e extraídos) como [propriedades](./options-data.html#props) do componente ou [eventos customizados](./options-data.html#emits). Quando um componente não possui nenhuma propriedade declarada ou eventos customizados, esse essencialmente contêm todos os bindings do escopo-pai, e podem ser passados abaixo para um componente interno via `v-bind="$attrs'"` - útil na criação de componentes de prioridade alta. |
144 | 144 |
|
145 |
| -- **See also:** |
146 |
| - - [Non-Prop Attributes](../guide/component-attrs.html) |
| 145 | +- **Veja também:** |
| 146 | + - [Atributos Não-Propriedades](../guide/component-attrs.html) |
0 commit comments