-
Notifications
You must be signed in to change notification settings - Fork 5k
Open
Labels
discussionTopics to discuss that don't have clear action items yetTopics to discuss that don't have clear action items yet
Description
In v3 v-on was merged with props, for that to happen props started with on* are treated as events
<Comp
@myEvent="log('myEvent')"
@my-event="log('my-event')"
:onMyEvent="()=>log('onMyEvent')"
/>
<! -- CONVERTED TO -->
h(Comp, {
onMyEvent: [
_cache[0] || (_cache[0] = $event => (log('myEvent'))),
_cache[1] || (_cache[1] = $event => (log('my-event'))),
()=>log('onMyEvent')
]
})You can also declare events as props
defineComponent({
props: {
onClick: Function, // similar to emit: ['click']
}
})Metadata
Metadata
Assignees
Labels
discussionTopics to discuss that don't have clear action items yetTopics to discuss that don't have clear action items yet