diff --git a/packages/plugins/templates/keepalive/context.tpl b/packages/plugins/templates/keepalive/context.tpl index 7b0cf8e5..a6eab5c2 100644 --- a/packages/plugins/templates/keepalive/context.tpl +++ b/packages/plugins/templates/keepalive/context.tpl @@ -442,7 +442,8 @@ export function useKeepOutlets() { {...tabProps} {{#isNewTabsAPISupported}} items={Object.entries(keepElements.current).map(([pathname, {name, icon, closable, children, ...other}]: any) => ({ - label: <>{icon}{name}, + label: name, + icon: icon, key: `${pathname?.toLowerCase()}::${tabNameMap[pathname?.toLowerCase()]}`, closable: Object.entries(keepElements.current).length === 1 ? false : closable, {{#hasFixedHeader}} @@ -462,7 +463,10 @@ export function useKeepOutlets() { } } {{/hasFixedHeader}} key={`${pathname?.toLowerCase()}::${tabNameMap[pathname?.toLowerCase()]}`} - tab={<>{icon}{name}} + tab={ + {icon} + {name} + } closable={Object.entries(keepElements.current).length === 1?false:closable} {...other} />