Skip to content
Discussion options

You must be logged in to vote

Nothing is actually missing on the Nuxt UI side — the slot is typed, it's WebStorm's own Vue inspection that can't see it.

UTable builds its dynamic slot names from your row type with template-literal types (src/runtime/components/Table.vue):

type DynamicCellSlots<T, K = keyof T> = Record<`${K extends string ? K : never}-cell` | (string & {}), (props: CellContext<T, unknown>) => VNode[]>

So for { price: number; quantity: number } you get price-cell / quantity-cell (plus any other string, since column ids don't have to be keys of the row), and #price-cell type-checks fine with vue-tsc / nuxi typecheck. WebStorm's Unrecognized slot inspection (VueUnrecognizedSlot) can't enumerate the keys o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by YeBytes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants