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
I import the prop types from another file. Therefore styleguidist does not read the documentation that are written there. Containing types in the SFCs might be fine with the simple ones. But when the component has many props or complex types it pollutes the file and it becomes a common practice to put the types in a separate file.
// MyComponent.typesexporttypeProps={/** * This prop does things */myProp?: string;/** * This prop does cool things */myOtherCoolProp?: SomeComplexTypeDefinedInThisFile}
// MyComponent.vueimporttype*asTfrom'./MyComponent.types'// This won't read the comments from the imported typesconstprops=defineProps<T.Props>();
I really like how flexible vue-docgen-api is. Using vue-compoenent-meta will mean that I will need to use both. But in any case, thank you for the pointer.
Edit: I just saw this PR got merged. I'll give it another try.
Edit 2: It didn't work
@elevatebart with the PR above actually works. The docgen was able to extract the documentation when I imported the types separately but it didn't work when I imported all of them. Here are examples, in case there is an easy fix:
The problem
I import the prop types from another file. Therefore styleguidist does not read the documentation that are written there. Containing types in the SFCs might be fine with the simple ones. But when the component has many props or complex types it pollutes the file and it becomes a common practice to put the types in a separate file.
Proposed solution
I don't have any proposal, sorry.
Alternative solutions
None
Additional context
Since Vue also started to support the imported types on SFC macros it can be a common way to move the types in their own file.
The text was updated successfully, but these errors were encountered: