You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SFCs export component.__docgenInfo whereas components export component.options.__docgenInfo, making it complicated to display prop tables across both kinds.
The former uses SFCs and the latter uses regular components. I didn't set up either project and am not familiar enough with Vue to know whether they are following proper conventions, but this issue assumes they are. Both repos repos use @storybook/addon-docs to show prop tables.
Expected behavior
Both repos should show prop tables for all stories that define the component parameter.
Outputs
vue-kitchen-sink shows prop tables as expected. When I log component inside vue-docgen-loader, it's of the form:
This loader started from SFC support only, then plain component (non-SFC) support was added. Since the current implementation for plain components is based on the SFC version, I should more research on the Vue's component spec...
Immediate solution is adding conditionals (ex. isSFC) for the code injection will, but I think we shouldn't do it because it might break other use-cases such as functional components and Vue.extend style components
Describe the bug
SFCs export
component.__docgenInfo
whereas components exportcomponent.options.__docgenInfo
, making it complicated to display prop tables across both kinds.To Reproduce
I am working on two repos:
The former uses SFCs and the latter uses regular components. I didn't set up either project and am not familiar enough with Vue to know whether they are following proper conventions, but this issue assumes they are. Both repos repos use
@storybook/addon-docs
to show prop tables.Expected behavior
Both repos should show prop tables for all stories that define the
component
parameter.Outputs
vue-kitchen-sink
shows prop tables as expected. When I logcomponent
insidevue-docgen-loader
, it's of the form:When I log it inside the prop table extraction, it's of the form:
Thus, the prop table extraction code, which expects
component.__docgenInfo
succeeds.In contrast, the
evergarden
code has the following structure inside the loader:And when I log it inside the props table extraction:
Therefore, the prop tables don't extract properly.
Versions
vue-kitchen-sink:
evergarden:
Additional context
cc @Aaron-Pool
The text was updated successfully, but these errors were encountered: