-
-
Notifications
You must be signed in to change notification settings - Fork 133
Open
Description
I have been seing this error for a few months, possibly after the introduction of 342ba88.
The <CNavItem>
elements now require the class
attribute, even if it's an empty string:
> vue-tsc --noEmit -p tsconfig.vitest.json --composite false
src/components/AdminSubHeader.vue:14:6 - error TS2345: Argument of type '{ as: string; }' is not assignable to parameter of type 'Partial<{ disabled: boolean; as: string; active: boolean; }> & Omit<{ readonly as: string; readonly class: string; readonly disabled?: boolean | undefined; readonly active?: boolean | undefined; readonly href?: string | undefined; } & VNodeProps & AllowedComponentProps & ComponentCustomProps, "as" | ... 1 more ... |...'.
Property 'class' is missing in type '{ as: string; }' but required in type 'Omit<{ readonly as: string; readonly class: string; readonly disabled?: boolean | undefined; readonly active?: boolean | undefined; readonly href?: string | undefined; } & VNodeProps & AllowedComponentProps & ComponentCustomProps, "as" | ... 1 more ... | "disabled">'.
14 <CNavItem as="li">
~~~~~~~~
node_modules/@coreui/vue/dist/esm/components/nav/CNavItem.d.ts:11:5
11 class: string;
~~~~~
'class' is declared here.
Adding an empty class
attribute fixes the typing issue:
- <CNavItem as="li">
+ <CNavItem class="">
(the as
attribute is now optional, I removed it too)
This is on:
- Linux, Fedora 42
- Node 22.18, NPM 10.9.3, Typescript 5.7.3, CoreUI 5.1.1, CoreUI-Vue 5.2.0
Metadata
Metadata
Assignees
Labels
No labels