DEV Community

Discussion on: Feature: Vue 3 script setup

Collapse
 
defucc profile image
DeFUCC

What about defining emits used in the template with $emit('eventName')? I've found the function defineEmit(), but can't figure out how to use it...

Collapse
 
jjclxrk profile image
jjclxrk

If anyone else is stuck on this too, I eventually found the answer here: github.com/vuejs/rfcs/pull/227#iss...

const emit = defineEmit(['foo']);
Enter fullscreen mode Exit fullscreen mode