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

v0.8.0 DataTable 'string' is not assignable to type 'object' error #160

Open
chiarotto opened this issue Feb 24, 2024 · 1 comment
Open

Comments

@chiarotto
Copy link

chiarotto commented Feb 24, 2024

Running
> vue-tsc --build --force
I get the following:

error TS2322: Type 'string' is not assignable to type 'object'.

34 tableStyle="min-width: 50rem">
~~~~~~~~~~
node_modules/primevue/datatable/DataTable.d.ts:1120:5
1120 tableStyle?: object | undefined;
~~~~~~~~~~
The expected type comes from property 'tableStyle' which is declared here on type 'DataTableProps & VNodeProps & AllowedComponentProps & ComponentCustomProps & Record<string, unknown>'

But in the docs,( https://tailwind.primevue.org/datatable/ ) the example reports:
DataTable :value="products" tableStyle="min-width: 50rem"

@chiarotto chiarotto changed the title v0.8.0 DataTable tableStyle="min-width: 50rem" v0.8.0 DataTable 'string' is not assignable to type 'object' error Feb 25, 2024
@aasiph
Copy link

aasiph commented Mar 2, 2024

Although the string passed (tableStyle="min-width: 50rem") works in dev mode but when we build for production it gives error.

tableStyle requires object or undefined as the error says.
I changed it to :tableStyle="{'min-width': '50rem'}" and this works.

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

No branches or pull requests

2 participants