Skip to content

Commit

Permalink
Update events.md - Diff between Options API and Composition API text
Browse files Browse the repository at this point in the history
The emits support for object sintax for Options API text was displayed for both, Options and Composition API.
  • Loading branch information
leoelz authored Oct 26, 2023
1 parent ca0ece7 commit 9a957c8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/guide/components/events.md
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,10 @@ export default {

</div>

The `emits` option also supports an object syntax, which allows us to perform runtime validation of the payload of the emitted events:

<div class="composition-api">

The `defineEmits()` macro also supports an object syntax, which allows us to perform runtime validation of the payload of the emitted events:

```vue
<script setup>
const emit = defineEmits({
Expand Down Expand Up @@ -207,6 +207,8 @@ More details: [Typing Component Emits](/guide/typescript/composition-api#typing-
</div>
<div class="options-api">

The `emits` option also supports an object syntax, which allows us to perform runtime validation of the payload of the emitted events:

```js
export default {
emits: {
Expand Down

0 comments on commit 9a957c8

Please sign in to comment.