Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: Vue3 PropType declarations are not parsed correctly or correctly editable on the autodocs page. #22209

Closed
its-lee opened this issue Apr 21, 2023 · 3 comments

Comments

@its-lee
Copy link

its-lee commented Apr 21, 2023

Describe the bug

For Vue3 codebases, when defining a prop with PropType as a string union type, the user should be able to select from the list of options on the autodocs page.

E.g.:

    colour: {
      type: String as PropType<Colour>,
      default: "red",
    },

What actually happens is that when defining a prop with PropType as a string union type, the data type is inferred as object, and you can not even enter the string value of the prop on the autodocs page as it expects an stringified object to be passed.

issue

To Reproduce

https://github.com/its-lee/storybook-vue3-proptype-issue

System

Environment Info:

  System:
    OS: macOS 13.1
    CPU: (8) arm64 Apple M1 Pro
  Binaries:
    Node: 16.19.0 - ~/.nvm/versions/node/v16.19.0/bin/node
    Yarn: 1.22.19 - /opt/homebrew/bin/yarn
    npm: 8.19.3 - ~/.nvm/versions/node/v16.19.0/bin/npm
  Browsers:
    Chrome: 112.0.5615.137
    Firefox: 111.0.1
    Safari: 16.2
  npmPackages:
    @storybook/addon-essentials: ^7.0.6 => 7.0.6 
    @storybook/addon-interactions: ^7.0.6 => 7.0.6 
    @storybook/addon-links: ^7.0.6 => 7.0.6 
    @storybook/blocks: ^7.0.6 => 7.0.6 
    @storybook/testing-library: ^0.0.14-next.2 => 0.0.14-next.2 
    @storybook/vue3: ^7.0.6 => 7.0.6 
    @storybook/vue3-vite: ^7.0.6 => 7.0.6

Additional context

No response

@larsrickert
Copy link
Contributor

Hey, this will be fixed in #22285

@its-lee
Copy link
Author

its-lee commented Feb 17, 2024

Amazing - what's been done there makes sense to me!

@larsrickert
Copy link
Contributor

Fixed with #22285 in version 8

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants