fix: menu click not trigger #1470

pull/1483/head
tanjinzhou 2019-11-28 17:32:46 +08:00
parent 16ec40a012
commit 586dc46d90
1 changed files with 6 additions and 7 deletions

View File

@ -308,7 +308,6 @@ const SubPopupMenu = {
this.instanceArrayKeyIndexMap[key] = Object.keys(this.instanceArrayKeyIndexMap).length; this.instanceArrayKeyIndexMap[key] = Object.keys(this.instanceArrayKeyIndexMap).length;
} }
const childListeners = getEvents(child); const childListeners = getEvents(child);
const isSubMenu = child.componentOptions && child.componentOptions.Ctor.options.isSubMenu;
const newChildProps = { const newChildProps = {
props: { props: {
mode: childProps.mode || props.mode, mode: childProps.mode || props.mode,
@ -334,11 +333,11 @@ const SubPopupMenu = {
...extraProps, ...extraProps,
}, },
on: { on: {
click: isSubMenu click: e => {
? noop if ('keyPath' in e) {
: e => {
(childListeners.click || noop)(e); (childListeners.click || noop)(e);
this.onClick(e); this.onClick(e);
}
}, },
itemHover: this.onItemHover, itemHover: this.onItemHover,
openChange: this.onOpenChange, openChange: this.onOpenChange,