Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

CNavItem.class is now a required property #305

Open
@abompard

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

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /