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

fix(component-meta): defineSlots allows empty params #4093

Merged

Conversation

Evertvdw
Copy link
Contributor

When using defineSlots without a function argument it would throw an error as paramType can be undefined in that case. By adding this check this can be prevented.

I used a getAnyType now in case of no types, but I'm not sure if that is the best approach. The equivelent using a template-slot will generate an empty object as type. I'm not sure why and how to replicate that in this code, feel free to improve.

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.
@Evertvdw Evertvdw changed the title Bugfix/defineslots empty function (fixes #4091) fix: defineslots empty function error (#4091) Mar 15, 2024
@Evertvdw
Copy link
Contributor Author

@johnsoncodehk There are build errors introduced by the auto-fix workflow that you added. A heads up as you might want to know.

@johnsoncodehk
Copy link
Member

LGTM, thanks!

@johnsoncodehk johnsoncodehk changed the title fix: defineslots empty function error (#4091) fix: defineslots empty function error Mar 20, 2024
@johnsoncodehk johnsoncodehk changed the title fix: defineslots empty function error fix(component-meta): defineSlots allows empty params Mar 20, 2024
@johnsoncodehk johnsoncodehk merged commit c09b94c into vuejs:master Mar 20, 2024
3 checks passed
@Evertvdw Evertvdw deleted the bugfix/defineslots-empty-function branch March 20, 2024 07:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] vue-component-meta does not work correctly when using slots without defined props
3 participants