Fix tab titles not rendering for plain-text tabs

titleRenderer was always set as a function reference in
buildRegistration(), so the v-if="tab.titleRenderer" guard in GTabs
was always true. TabTitleContent would then return a plain string
which Vue 2.7 can't render from a render function, producing empty
tab labels.

Only set titleRenderer when the tab actually has a title slot,
so plain-text titles fall through to the {{ tab.title }} template
interpolation.
This commit is contained in:
Dannon Baker
2026-03-23 20:28:25 -04:00
parent ad9f6f4f18
commit 763f810c8d
@@ -54,17 +54,10 @@ const shouldRender = computed(() => {
return hasBeenActive.value;
});
function titleRenderer() {
if (slots.title) {
return slots.title();
}
return undefined;
}
function buildRegistration(): TabRegistration {
return {
title: props.title,
titleRenderer,
titleRenderer: slots.title ? () => slots.title!() : undefined,
disabled: props.disabled,
id: props.id,
buttonId: props.buttonId,