-
-
Notifications
You must be signed in to change notification settings - Fork 180
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modification Advice on 'vemit-child' Snippet #114
Comments
This is correct syntax. In Vue 3 you can define emits with the <script setup lang="ts">
const emit = defineEmits<{ (event: 'eventName', id: string): void }>()
</script>
<template>
<button @click="emit('eventName', 'abc')" />
</template> You can find more information here: https://vuejs.org/guide/typescript/composition-api.html#typing-component-emits |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The original snippet was:
I guess you are trying to type
$emit
but the$
was recognized as a symbol for placeholder. You can use\\$
in the snippet body instead.The text was updated successfully, but these errors were encountered: