Skip to content

Autodocs page is missing props, emits and slots for Vue components in vue project #28817

Answered by Marklb
Walnussbaer asked this question in Help
Discussion options

You must be logged in to vote

I configured a sandbox similar to how I assume yours is and noticed the problem. So, I debugged the docgen plugin's transformer and saw the source code it received didn't look the same as what a vite.config.ts got. So, I moved the docgen plugin to the end of the array and it worked.

Try adding the following to the bottom of your viteFinal function.

const idx = (config.plugins as any).findIndex(x => x?.name === 'storybook:vue-docgen-plugin')
const plugin = config.plugins[idx]
config.plugins.splice(idx, 1)
config.plugins.push(plugin)

I don't know much about Vue, so I don't know if there is a known better way to handle this. All I did was follow the code and make it work.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@Walnussbaer
Comment options

@Marklb
Comment options

Marklb Aug 7, 2024
Collaborator

@Walnussbaer
Comment options

@Walnussbaer
Comment options

@sschneider-ihre-pvs
Comment options

Answer selected by Walnussbaer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
3 participants