-
-
Notifications
You must be signed in to change notification settings - Fork 408
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
vue-component-meta: Include JSDoc / description for emits/events #3893
Comments
I would love this enhancement too! Currently we are extracting the emits comment manually on radix-vue |
Support by a27caa1 and vuejs/core#10801 (It should release in Vue 3.5). Please note that shorthand is impossible to support JSDoc, it must be: defineEmits<{
/** Emitted when foo... */
(evt: "foo", value: string): void
}>(); |
Although this issue is closed, I don't see a solution to this problem in the current version of vue@3.5.10 and vue-component-meta@2.1.6. @johnsoncodehk can you tell me what the status of this feature is now? thanks |
I am also using defineEmits<{
/**
* Emitted when the `modelValue` property changes.
*/
(evt: "update:modelValue", value: any): void;
/**
* Emitted when `filtering` or `virtual-scrolling` change the available
* filtered options.
*/
(e: "update:filtered", value: string[]): void;
}>(); The |
Hey, is it possible to add the missing feature to
vue-component-meta
that also extracts the JSDoc / description of emits/events?For props, exposes and slots this is already possible, however it does not work for emits/events.
Why?
I am currently working on this Storybook PR that switches to vue language tools (Volar) / vue-component-meta for generating the documentation for props, emits/events, slots and exposed. It works like a charm except the missing feature for emits/events descriptions which would be very nice to have!
Versions
node: 20.10.0
typescript: 5.3.3
vue-component-meta: 1.8.27
vue: 3.4.19
Reproduction
Vue component:
vue-component-meta
Code:Output
The logged output can be seen below. I only included the "events" property to keep it minimal.
I would expect the event to also have a
description
property with the value "Emitted when foo..."The text was updated successfully, but these errors were encountered: