fix[menu]: the native title attribute of the SubMenu component is always null

pull/7968/head
伊墨 2024-12-05 10:14:30 +08:00
parent 4a37016f4e
commit 973cd2e269
1 changed files with 3 additions and 2 deletions

View File

@ -257,14 +257,15 @@ export default defineComponent({
const subMenuPrefixClsValue = subMenuPrefixCls.value;
const icon = props.icon ?? slots.icon?.(props);
const expandIcon = props.expandIcon || slots.expandIcon || menuExpandIcon.value;
const title = renderTitle(getPropsSlot(slots, props, 'title'), icon);
const originTitle = getPropsSlot(slots, props, 'title');
const title = renderTitle(originTitle, icon);
return (
<div
style={directionStyle.value}
class={`${subMenuPrefixClsValue}-title`}
tabindex={mergedDisabled.value ? null : -1}
ref={elementRef}
title={typeof title === 'string' ? title : null}
title={typeof originTitle === 'string' ? originTitle : null}
data-menu-id={key}
aria-expanded={open.value}
aria-haspopup