Closed
Description
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
- Create a component with AccordionHeader with a
<template #default="{ active }">...
- Observe linting error in VSCode
Expected behavior
- No linting error
- Code completion
Metadata
Metadata
Assignees
Labels
Type
Projects
Status
Done