Skip to content

AccordionHeader type definition .d.ts does not declare the active prop #7591

Closed
@space88man

Description

@space88man

Describe the bug

Triage: this is a type definition and linting issue; not a code issue

In AccordionHeader.vue there is an active prop available in the default slot but it is not declared in .d.ts .

<!-- AccordionHeader.vue -->
<template>
    <component v-if="!asChild" :is="as" v-ripple :data-p="dataP" :class="cx('root')" @click="onClick" v-bind="attrs">
        <slot :active="$pcAccordionPanel.active"></slot>

This means that

<AccordionHeader>
    <template #default="{ active }"><span>Is active? {{ active }}</span></template>
</AccordionHeader>

is flagged as a linting error

Pull Request Link

Proposed PR: #7592

Other Reason

In Dialog: the container slot has a prop closeCallback that is declared in d.ts:

    /**
     * Custom container slot.
     * @param {Object} scope - container slot's params.
     */
    container(scope: {
        /**
         * Close dialog function.
         */
        closeCallback: () => void;
        /**
         * Maximize/minimize dialog function.
         * @param {Event} event - Browser event
         */
        maximizeCallback: (event: Event) => void;
    }): VNode[];

In AccordionHeader.d.ts the default slot is declared without any scope object:

default() :  VNode[];

It could be changed to:

default(scope: {
    active: boolean,
}) :  VNode[];

Reproducer

https://github.com/space88man/accordionheader-issue

Environment

Using CSR, Linux, VSCode (1.99.0, “Vue - Official” extension v2.2.8, ESLint extension 3.0.10)

Vue version

3.5.13

PrimeVue version

4.3.3

Node version

22.14.0

Browser(s)

No response

Steps to reproduce the behavior

  1. Create a component with AccordionHeader with a <template #default="{ active }">...
  2. Observe linting error in VSCode

Expected behavior

  1. No linting error
  2. Code completion

Metadata

Metadata

Labels

Type: BugIssue contains a bug related to a specific component. Something about the component is not working

Type

No type

Projects

Status

Done

Relationships

None yet

Development

No branches or pull requests

Issue actions