|
1 |
| -# Instance Properties |
| 1 | +# Propriedades da 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. A instância do componente faz _proxy_ de acesso às propriedades em seu 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 as props atuais que o componente recebeu. A instância do componente faz _proxy_ de acesso às propriedades em seu objeto de props. |
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 |
| - For components using [fragments](../guide/migration/fragments), `$el` will be the placeholder DOM node that Vue uses to keep track of the component's position in the DOM. It is recommended to use [template refs](../guide/component-template-refs.html) for direct access to DOM elements instead of relying on `$el`. |
| 31 | + Para componentes usando [fragmentos](../guide/migration/fragments), `$el` será o nó DOM _placeholder_ que o Vue usa para acompanhar a posição do componente no DOM. Recomenda-se usar [_refs_ de _template_](../guide/component-template-refs.html) para acesso direto aos elementos DOM em vez de depender de `$el`. |
32 | 32 |
|
33 | 33 | ## $options
|
34 | 34 |
|
35 |
| -- **Type:** `Object` |
| 35 | +- **Tipo:** `Object` |
36 | 36 |
|
37 |
| -- **Read only** |
| 37 | +- **Somente leitura** |
38 | 38 |
|
39 |
| -- **Details:** |
| 39 | +- **Detalhes:** |
40 | 40 |
|
41 |
| - The instantiation options used for the current component instance. This is useful when you want to include custom properties in the options: |
| 41 | + As opções da instanciação usadas pela instância do componente atual. Isso é útil quando você deseja incluir propriedades personalizadas nas opções: |
42 | 42 |
|
43 | 43 | ```js
|
44 | 44 | const app = createApp({
|
|
51 | 51 |
|
52 | 52 | ## $parent
|
53 | 53 |
|
54 |
| -- **Type:** `Component instance` |
| 54 | +- **Tipo:** `Component instance` |
55 | 55 |
|
56 |
| -- **Read only** |
| 56 | +- **Somente leitura** |
57 | 57 |
|
58 |
| -- **Details:** |
| 58 | +- **Detalhes:** |
59 | 59 |
|
60 |
| - The parent instance, if the current instance has one. |
| 60 | + A instância pai, se a instância atual tiver uma. |
61 | 61 |
|
62 | 62 | ## $root
|
63 | 63 |
|
64 |
| -- **Type:** `Component instance` |
| 64 | +- **Tipo:** `Component instance` |
65 | 65 |
|
66 |
| -- **Read only** |
| 66 | +- **Somente leitura** |
67 | 67 |
|
68 |
| -- **Details:** |
| 68 | +- **Detalhes:** |
69 | 69 |
|
70 |
| - The root component instance of the current component tree. If the current instance has no parents this value will be itself. |
| 70 | + A instância do componente raiz da árvore de componentes atual. Caso a instância atual não tenha pais, este valor será ela mesmo. |
71 | 71 |
|
72 | 72 | ## $slots
|
73 | 73 |
|
74 |
| -- **Type:** `{ [name: string]: (...args: any[]) => Array<VNode> | undefined }` |
| 74 | +- **Tipo:** `{ [name: string]: (...args: any[]) => Array<VNode> | undefined }` |
75 | 75 |
|
76 |
| -- **Read only** |
| 76 | +- **Somente Leitura** |
77 | 77 |
|
78 |
| -- **Details:** |
| 78 | +- **Detalhes:** |
79 | 79 |
|
80 |
| - 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`. |
| 80 | + Usado para o acesso de conteúdo [distribuído com slots](../guide/component-basics.html#distribuicao-de-conteudo-com-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 outros nós não incluídos nos slots nomeados ou conteúdos do `v-slot:default`. |
81 | 81 |
|
82 |
| - Accessing `this.$slots` is most useful when writing a component with a [render function](../guide/render-function.html). |
| 82 | + Acessar `this.$slots` é mais útil ao construir um componente com uma [função de renderização](../guide/render-function.html). |
83 | 83 |
|
84 |
| -- **Example:** |
| 84 | +- **Exemplo:** |
85 | 85 |
|
86 | 86 | ```html
|
87 | 87 | <blog-post>
|
88 | 88 | <template v-slot:header>
|
89 |
| - <h1>About Me</h1> |
| 89 | + <h1>Sobre</h1> |
90 | 90 | </template>
|
91 | 91 |
|
92 | 92 | <template v-slot:default>
|
93 | 93 | <p>
|
94 |
| - Here's some page content, which will be included in $slots.default. |
| 94 | + Aqui está o conteúdo da página, que será incluído em $slots.default. |
95 | 95 | </p>
|
96 | 96 | </template>
|
97 | 97 |
|
|
116 | 116 | })
|
117 | 117 | ```
|
118 | 118 |
|
119 |
| -- **See also:** |
120 |
| - - [`<slot>` Component](built-in-components.html#slot) |
121 |
| - - [Content Distribution with Slots](../guide/component-basics.html#content-distribution-with-slots) |
122 |
| - - [Render Functions - Slots](../guide/render-function.html#slots) |
| 119 | +- **Ver também:** |
| 120 | + - [Componente `<slot>`](built-in-components.html#slot) |
| 121 | + - [Distribuição de Conteúdo com Slots](../guide/component-basics.html#distribuicao-de-conteudo-com-slots) |
| 122 | + - [Funções de Renderização - Slots](../guide/render-function.html#slots) |
123 | 123 |
|
124 | 124 | ## $refs
|
125 | 125 |
|
126 |
| -- **Type:** `Object` |
| 126 | +- **Tipo:** `Object` |
127 | 127 |
|
128 |
| -- **Read only** |
| 128 | +- **Somente leitura** |
129 | 129 |
|
130 |
| -- **Details:** |
| 130 | +- **Detalhes:** |
131 | 131 |
|
132 |
| -An object of DOM elements and component instances, registered with [`ref` attributes](../guide/component-template-refs.html). |
| 132 | +Um objeto dos elementos do DOM e as instâncias de componente, registrados com [atributos `ref`](../guide/component-template-refs.html) |
133 | 133 |
|
134 |
| -- **See also:** |
135 |
| - - [Template refs](../guide/component-template-refs.html) |
136 |
| - - [Special Attributes - ref](./special-attributes.md#ref) |
| 134 | +- **Ver também:** |
| 135 | + - [_refs_ de _Template_](../guide/component-template-refs.html) |
| 136 | + - [Atributos especiais - `ref`](./special-attributes.md#ref) |
137 | 137 |
|
138 | 138 | ## $attrs
|
139 | 139 |
|
140 |
| -- **Type:** `Object` |
| 140 | +- **Tipo:** `Object` |
141 | 141 |
|
142 |
| -- **Read only** |
| 142 | +- **Somente leitura** |
143 | 143 |
|
144 |
| -- **Details:** |
| 144 | +- **Detalhes:** |
145 | 145 |
|
146 |
| -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. |
| 146 | +Contém atributos vinculados do escopo-pai e eventos que não são reconhecidos (e extraídos) como [props](./options-data.html#props) de componentes ou [eventos personalizados](./options-data.html#emits). Quando um componente não possui nenhuma propriedade declarada ou eventos customizados, esse essencialmente contém todos os vínculos do escopo-pai, e pode ser passado abaixo para um componente interno via `v-bind="$attrs"` - útil ao criar componentes de ordem superior. |
147 | 147 |
|
148 |
| -- **See also:** |
149 |
| - - [Non-Prop Attributes](../guide/component-attrs.html) |
150 |
| - - [Options / Misc - inheritAttrs](./options-misc.html#inheritattrs) |
| 148 | +- **Veja também:** |
| 149 | + - [Atributos Não-Propriedades](../guide/component-attrs.html) |
| 150 | + - [Opções / Diversos - inheritAttrs](./options-misc.html#inheritattrs) |
0 commit comments