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] vue-component-meta does not work correctly when using slots without defined props #4091

Closed
Evertvdw opened this issue Mar 13, 2024 · 0 comments · Fixed by #4093
Closed
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first

Comments

@Evertvdw
Copy link
Contributor

Hi there!

I found a bug when using the vue-component-meta package inside Storybook. The autogenerated documentation inside storybook will break when there are slots without explicit props defined.

See https://stackblitz.com/edit/github-admhcw?file=src%2Fstories%2FButton2.vue for a reproduction.

Works:

defineSlots<{
  /**
   * Use for custom content, instead of relying on 'icon' and 'label' props
   */
  default: (props: {}) => VNode[];
  /**
   * Override the default QSpinner when in 'loading' state
   */
  loading: (props: {}) => VNode[];
}>();

Does not work:

defineSlots<{
  /**
   * Use for custom content, instead of relying on 'icon' and 'label' props
   */
  default: () => VNode[];
  /**
   * Override the default QSpinner when in 'loading' state
   */
  loading: () => VNode[];
}>();

Here is the related issue: storybookjs/storybook#26465

Evertvdw pushed a commit to Evertvdw/language-tools that referenced this issue Mar 13, 2024
When using `defineSlots` without a props argument it would throw an error. This fixes that, and makes sure the output is the same as with normal template slot usage.
@so1ve so1ve added the bug Something isn't working label Mar 14, 2024
@johnsoncodehk johnsoncodehk linked a pull request Mar 20, 2024 that will close this issue
@johnsoncodehk johnsoncodehk added the good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first label Mar 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants