Skip to content
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

Add @vue-slot and @vue-event annotation to document slots and emitted events #125

Closed
pbastowski opened this issue Oct 3, 2018 · 1 comment

Comments

@pbastowski
Copy link

pbastowski commented Oct 3, 2018

Update: I see that I should probably have added this to #102.

This is a proposal to extend jsdoc-vuejs with two new annotations:

@vue-slot
@vue-event

I need to document slots and events that are offered by my components. jsdoc does not have a suitable annotation for slots. There is the @emits annotation, but it does not work well for events, as it does not have a way to document the event's parameters (that I know of).

Both slots (scoped) and events (params) have an ability to pass parameters. It would be great if we had a @vue-slot and @vue-event annotation, which would allow us to follow it with @param annotations. @params would then describe the slots and events for us. The result would be a table for slots and a separate table for events.

For example

/**
 * The s-popup component displays a popup window with your text and an optional title.
 * 
 * @vue-slot activator Clicking this content will display the popup
 * @param {object} item This is purely fictional, just to demonstrate how the @param would be used
 *
 * @vue-slot [title] An optional popup title
 * @vue-slot default The content to be displayed
 *
 * @vue-event close
 * @param {string} result The button that the user clicked (OK or Cancel)
 * 

Is this feasible?

@pbastowski
Copy link
Author

Closing in favor of #102

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant