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

Accordion, Button, Step, Tab: Invalid prop warnings when component object passed to as prop #6266

Closed
WatCodeDatCode opened this issue Aug 20, 2024 · 1 comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@WatCodeDatCode
Copy link
Contributor

Describe the bug

The below components all accept an as prop that allow the HTML to be rendered optionally as a specific component. This prop however is only configured with type string so when a component is directly passed to it as an object, the console is flooded with the warning: [Vue warn]: Invalid prop: type check failed for prop "as". Expected String with value "[object Object]", got Object.

The functionality works regardless, but the warnings are distracting especially when debugging other issues in development so updating the prop to also allow Component type from vue (as the underlying component itself does) should fix the issue.

Affected components

  • AccordionContent
  • AccordionHeader
  • AccordiongPanel
  • Button
  • Step
  • StepPanel
  • Tab
  • TabPanel

Reproducer

https://stackblitz.com/edit/primevue-nuxt-issue-template-9rgq7g?file=app.vue

PrimeVue version

4.0.4

Vue version

4.x

Language

ALL

Build / Runtime

Nuxt

Browser(s)

No response

Steps to reproduce the behavior

  1. Import any component
  2. Use the component directly for the as prop in any of the above mentioned components
  3. Check logs / console

Expected behavior

A component object can be directly passed to the as prop without warning.

@WatCodeDatCode WatCodeDatCode added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Aug 20, 2024
@tugcekucukoglu
Copy link
Member

It is related to Nuxt: nuxt/nuxt#13659

@tugcekucukoglu tugcekucukoglu added Type: Bug Issue contains a bug related to a specific component. Something about the component is not working and removed Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible labels Aug 21, 2024
@tugcekucukoglu tugcekucukoglu added this to the 4.0.5 milestone Aug 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Projects
None yet
Development

No branches or pull requests

2 participants