fix: menu Item title setting (#2528)

pull/2538/head
xrkffgg 2020-07-07 13:52:54 +08:00 committed by GitHub
parent 9195ba5fa9
commit a4389ca193
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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) {