Skip to content

Document new emits: option and component event behaviour / removal of .native modifier #592

Closed
@LinusBorg

Description

@LinusBorg

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
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions