Closed
Description
We can now use emits:
to define the events emitted by our components.
this sounds like an additional feature but really is necessary if you don't want to have custom event listeners be attached to the root node.
- The
.native
modifier for component event listeners was removed - All events on a component will be added to the root element unless explicitly specified as component emitted events with the
emits
option:
<my-component @changed="handleThisCustomEvent" @click="handleThisNatieClick" />
<template>
<div>
<!-- the click listener will be applied to this div, but the `changed` listener will not -->
</div>
</template>
<script>
export default {
emits: ['changed']
}
</script>
Metadata
Metadata
Assignees
Labels
No labels