storybookjs/storybook

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

开放

#28,558 创建于 2024年7月11日

 (5 条评论) (0 个反应) (0 位负责人)TypeScript (10,058 个派生)batch import
bugdocgenhelp wantedsev:S3vue3

仓库指标

星标
 (89,909 个星标)
PR 合并指标
 (平均合并 7天 22小时) (30 天内合并 184 个 PR)

描述

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

贡献者指南