Skip to content

CNavItem.class is now a required property #305

@abompard

Description

@abompard

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy