From a4389ca193deccde98239d6c32cec28499dcf970 Mon Sep 17 00:00:00 2001 From: xrkffgg Date: Tue, 7 Jul 2020 13:52:54 +0800 Subject: [PATCH] fix: menu Item title setting (#2528) --- components/menu/MenuItem.jsx | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/components/menu/MenuItem.jsx b/components/menu/MenuItem.jsx index c9196d999..c1ad3c96a 100644 --- a/components/menu/MenuItem.jsx +++ b/components/menu/MenuItem.jsx @@ -21,8 +21,14 @@ export default { const { level, title, rootPrefixCls } = props; const { getInlineCollapsed, $slots, $attrs: attrs } = this; const inlineCollapsed = getInlineCollapsed(); + let tooltipTitle = title; + if (typeof title === 'undefined') { + tooltipTitle = level === 1 ? $slots.default : ''; + } else if (title === false) { + tooltipTitle = ''; + } const tooltipProps = { - title: title || (level === 1 ? $slots.default : ''), + title: tooltipTitle, }; const siderCollapsed = this.layoutSiderContext.sCollapsed; if (!siderCollapsed && !inlineCollapsed) {