primefaces / primevue-tailwind

PrimeVue Components Styled with Tailwind CSS
https://tailwind.primevue.org
MIT License
615 stars 74 forks source link

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

Closed chiarotto closed 3 weeks ago

chiarotto commented 8 months ago

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"

aasiph commented 8 months ago

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.

cagataycivici commented 3 weeks ago

As of v4.1.1, the new Tailwind styles have been rewritten using the preprocessor approach with @apply instead of pass-through. As a result this issue is not relevant any more.

New Website is live.