storybookjs/storybook

[Bug]: @values in prop jsdoc do not populate controls through vue-docgen-api

Open

#28 558 ouverte le 11 juil. 2024

Voir sur GitHub
 (5 commentaires) (0 réactions) (0 assignés)TypeScript (89 909 stars) (10 058 forks)batch import
bugdocgenhelp wantedsev:S3vue3

Description

Describe the bug

I expect that providing @values or type to a prop should result in an enum/select style, as that's the functionality of vue-docgen-api, but I'm not seeing that behaviour.

Reproduction link

https://stackblitz.com/edit/github-hfdqmp?file=src%2Fstories%2FButton.stories.js,src%2Fstories%2FButton.vue&preset=node

Reproduction steps

  1. Go to link
  2. Observe jsdoc block in component
  3. look at props table in docs story. It is a string input, but should be a select or radio button with the valid options provided in the jsdoc comment: @values 'small', 'medium', 'large'

System

Based on storybook.new starter I linked in the repro, but also happening in v7 and 8.2.1. 
I also tested the `vue-cli` and `typescript` Vue 3 starters on stackblitz.

Additional context

Also note the vue-component-meta is not working in this way as expected either, as demonstrated here: https://stackblitz.com/edit/github-akbacb?file=src%2Fstories%2FButton.stories.ts,src%2Fstories%2FButton.vue,.storybook%2Fmain.ts&preset=node

Guide contributeur