You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/guide/component-custom-events.md
+8-8Lines changed: 8 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,19 +39,19 @@ No caso de um evento nativo (por exemplo, `click`) ser definido na opção `emit
39
39
Recomenda-se definir todos os eventos emitidos para documentar melhor como um componente deve funcionar.
40
40
:::
41
41
42
-
### Validate Emitted Events
42
+
### Validar Eventos Emitidos
43
43
44
-
Similar to prop type validation, an emitted event can be validated if it is defined with the Object syntax instead of the Array syntax.
44
+
Semelhante à validação de propriedades, um evento emitido pode ser validado se for definido com a sintaxe Object em vez da sintaxe Array.
45
45
46
-
To add validation, the event is assigned a function that receives the arguments passed to the`$emit`call and returns a boolean to indicate whether the event is valid or not.
46
+
Para adicionar validação, o evento recebe uma função que recebe os argumentos passados para a chamada`$emit`e retorna um booleano para indicar se o evento é válido ou não.
By default, `v-model`on a component uses`modelValue`as the prop and `update:modelValue`as the event. We can modify these names passing an argument to`v-model`:
74
+
Por padrão, `v-model`em um componente usa`modelValue`como propriedade e `update:modelValue`como evento. Podemos modificar esses nomes passando um argumento para`v-model`:
75
75
76
76
```html
77
77
<my-componentv-model:foo="bar"></my-component>
78
78
```
79
79
80
-
In this case, child component will expect a `foo`prop and emits `update:foo`event to sync:
80
+
Nesse caso, o componente filho espera a propriedade `foo`e emite o evento `update:foo`para sincronizar:
0 commit comments