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

[Bug Report][3.5.15] table-server header-type error #19599

Closed
Dominic-Marcelino opened this issue Apr 12, 2024 · 1 comment
Closed

[Bug Report][3.5.15] table-server header-type error #19599

Dominic-Marcelino opened this issue Apr 12, 2024 · 1 comment
Labels
duplicate The issue has already been reported

Comments

@Dominic-Marcelino
Copy link

Environment

Vuetify Version: 3.5.15
Vue Version: 3.4.21
Browsers: Chrome 123.0.0.0
OS: Mac OS 10.15.7

Steps to reproduce

The expected type for the header prop of the v-data-table-server component isn't compatible with the needed format.

Expected Behavior

I'd expect the following header to be type compatible:

const headers = ref([
     {
       title: 'Dessert (100g serving)',
       align: 'start',
       sortable: false,
       key: 'name',
     },
     { title: 'Calories', key: 'calories', align: 'end' },
     { title: 'Fat (g)', key: 'fat', align: 'end' },
     { title: 'Carbs (g)', key: 'carbs', align: 'end' },
     { title: 'Protein (g)', key: 'protein', align: 'end' },
     { title: 'Iron (%)', key: 'iron', align: 'end' },
   ])

Actual Behavior

It thwows an typescript error

Reproduction Link

https://play.vuetifyjs.com/#...

Other comments

Could be related to #16680 but not 100% sure

@KaelWD
Copy link
Member

KaelWD commented Apr 15, 2024

The workaround for that is as const so the string literal types are inferred correctly, but yes #16680 will allow you to import the interface instead.

@KaelWD KaelWD closed this as not planned Won't fix, can't repro, duplicate, stale Apr 15, 2024
@KaelWD KaelWD added the duplicate The issue has already been reported label Apr 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
duplicate The issue has already been reported
Projects
None yet
Development

No branches or pull requests

2 participants