fix: Menu component, wrong display Tooltip prompt problem

pull/3143/head
tangjinzhou 2020-10-28 23:16:41 +08:00
parent a60ba677c2
commit 5eb57fb1a9
1 changed files with 6 additions and 1 deletions

View File

@ -1,6 +1,7 @@
import { Item, itemProps } from '../vc-menu';
import { getOptionProps, getListeners } from '../_util/props-util';
import Tooltip from '../tooltip';
import { injectExtraPropsKey } from '../vc-menu/FunctionProvider';
function noop() {}
export default {
name: 'MenuItem',
@ -9,6 +10,10 @@ export default {
inject: {
getInlineCollapsed: { default: () => noop },
layoutSiderContext: { default: () => ({}) },
injectExtraProps: {
from: injectExtraPropsKey,
default: () => ({}),
},
},
isMenuItem: true,
methods: {
@ -18,7 +23,7 @@ export default {
},
render() {
const props = getOptionProps(this);
const { level, title, rootPrefixCls } = props;
const { level, title, rootPrefixCls } = { ...props, ...this.injectExtraProps.$attrs };
const { getInlineCollapsed, $slots, $attrs: attrs } = this;
const inlineCollapsed = getInlineCollapsed();
let tooltipTitle = title;