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

DataTable: [Vue warn]: Invalid prop: type check failed for prop "rowClass". Expected String | Object, got Function #5341

Closed
saeedkgr opened this issue Feb 26, 2024 · 4 comments
Labels
Type: Bug Issue contains a bug related to a specific component. Something about the component is not working
Milestone

Comments

@saeedkgr
Copy link

Describe the bug

in DataTable rowClass prop can be a function and work fine as function but in BaseDataTable.Vue defined as
rowClass: {
type: [String, Object],
default: null
},
so a warning generate in console when used as function.

Reproducer

ss

PrimeVue version

3.48.1

Vue version

3.x

Language

TypeScript

Build / Runtime

Nuxt

Browser(s)

chrome

Steps to reproduce the behavior

  1. define a function like
    const rowClass = (data) => {
    return ['cursor-pointer', { 'bc-changed-dataset': data.isChanged }]
    }
  2. define prop :rowClass='rowClass'

Expected behavior

no vue warning

@saeedkgr saeedkgr added the Status: Needs Triage Issue will be reviewed by Core Team and a relevant label will be added as soon as possible label Feb 26, 2024
@nikitakoliadin
Copy link

Same problem

@schoonc
Copy link

schoonc commented Feb 28, 2024

Looks like it was introduced by this commit:
image

@cuberinooo
Copy link

Same issue here: #5349

@shtse8
Copy link
Contributor

shtse8 commented Mar 14, 2024

I have the same, any fix and workaround for now?

@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 Mar 14, 2024
@tugcekucukoglu tugcekucukoglu added this to the 3.50.0 milestone Mar 14, 2024
tugcekucukoglu added a commit that referenced this issue Mar 14, 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

6 participants