Fixed #3904 - Panel: Header accessibility issue

pull/3913/head
Tuğçe Küçükoğlu 2023-04-26 14:18:19 +03:00
parent 0142b37aa5
commit 00bedf4181
2 changed files with 11 additions and 2 deletions

View File

@ -137,7 +137,16 @@ export interface PanelSlots {
/**
* Custom header template.
*/
header(): VNode[];
header(scope: {
/**
* Current id state as a string
*/
id: boolean;
/**
* Style class of the icon
*/
class: string;
}): VNode[];
/**
* Custom icons template.
*/

View File

@ -1,7 +1,7 @@
<template>
<div :class="containerClass" v-bind="ptm('root')">
<div class="p-panel-header" v-bind="ptm('header')">
<slot name="header">
<slot :id="ariaId + '_header'" name="header" class="p-panel-title">
<span v-if="header" :id="ariaId + '_header'" class="p-panel-title" v-bind="ptm('title')">{{ header }}</span>
</slot>
<div class="p-panel-icons" v-bind="ptm('icons')">