mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user