Skip to content

Commit a4389ca

Browse files
authored
fix: menu Item title setting (#2528)
1 parent 9195ba5 commit a4389ca

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

components/menu/MenuItem.jsx

+7-1
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,14 @@ export default {
2121
const { level, title, rootPrefixCls } = props;
2222
const { getInlineCollapsed, $slots, $attrs: attrs } = this;
2323
const inlineCollapsed = getInlineCollapsed();
24+
let tooltipTitle = title;
25+
if (typeof title === 'undefined') {
26+
tooltipTitle = level === 1 ? $slots.default : '';
27+
} else if (title === false) {
28+
tooltipTitle = '';
29+
}
2430
const tooltipProps = {
25-
title: title || (level === 1 ? $slots.default : ''),
31+
title: tooltipTitle,
2632
};
2733
const siderCollapsed = this.layoutSiderContext.sCollapsed;
2834
if (!siderCollapsed && !inlineCollapsed) {

0 commit comments

Comments
 (0)