-
-
Notifications
You must be signed in to change notification settings - Fork 413
Spread props in Vue 3 components #1419
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
base: dev
Are you sure you want to change the base?
Conversation
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for an amazing idea. I really like it.
A couple of remarks on the implementation:
- Always add some kind of test to make explicit the use case you are solving for.
- You installed
@babel/traverse
while you use the localwalkes
, I am wondering why that is - There is a brilliant library maintained by @johnsoncodehk called vue-compeonent-meta. It's on par with Volar. It's very promising and could be a great typescript compliant alternative to docgen. It is still a WIP but it would, I think, solve your current issue.
- You might be able to test this in your own storybook
@@ -0,0 +1,127 @@ | |||
import path from 'path' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where is the sweet sweet set of tests you ran this file on?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, I plan to write tests for this later. Thank you!
packages/vue-docgen-api/src/script-setup-handlers/setupEventHandler.ts
Outdated
Show resolved
Hide resolved
@elevatebart thank you for your answer! |
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in 30 days if no further activity occurs. Thank you for your contributions. |
is it posible for this feature to be raken into consideration again? |
Hello. I have a problem in the Storybook + Vue 3 + Vite that my properties imported from another file are not showing up in the documentation.
I want to use all the features of the composition API and have property documentation.
I tried to implement such an opportunity in a wonderful vue-docgen-api
It may have turned out horribly, but this may push someone toward a better solution.
I note that parsing the properties of a component only works when importing from another file and using the spread operator.
Also, for the correct display of types, I use a wrapper from here propsFactory.ts
As a result, we get the opportunity to do something like
Properties
Component
And it now works in Storybook!
Once again, I note that this is not a complete solution, but rather a hack, maybe in the future I will finalize this or maybe someone will help make it better. Thank you!