diff --git a/components/_util/vnode.js b/components/_util/vnode.js index 64784e1bf..0687134a5 100644 --- a/components/_util/vnode.js +++ b/components/_util/vnode.js @@ -48,7 +48,7 @@ export function cloneElement (n, nodeProps, clone) { attrs = data.attrs, ref, } = nodeProps - node.data = Object.assign(data, { style, attrs, class: cls }) + node.data = Object.assign({}, data, { style, attrs, class: cls }) if (node.componentOptions) { node.componentOptions.propsData = node.componentOptions.propsData || {} node.componentOptions.listeners = node.componentOptions.listeners || {} @@ -96,5 +96,5 @@ export function getEvents (child) { } else if (child.data && child.data.on) { events = child.data.on } - return events + return { ...events } } diff --git a/components/menu/MenuItem.vue b/components/menu/MenuItem.vue index a7e6c39c2..8bda50307 100644 --- a/components/menu/MenuItem.vue +++ b/components/menu/MenuItem.vue @@ -7,7 +7,7 @@ import { getComponentFromProp } from '../_util/props-util' export default { props: itemProps, inject: { - inlineCollapsed: { default: false }, + getInlineCollapsed: { default: () => { false } }, }, isMenuItem: 1, methods: { @@ -16,20 +16,27 @@ export default { }, }, render (h) { - const { inlineCollapsed, $props: props, $slots, $attrs: attrs, $listeners } = this + const { getInlineCollapsed, $props: props, $slots, $attrs: attrs, $listeners } = this + const inlineCollapsed = getInlineCollapsed() const itemProps = { props, attrs, - on: $listeners, + on: { ...$listeners }, class: getClass(this), style: getStyle(this), } + const toolTipProps = { + props: { + placement: 'right', + overlayClassName: `${props.rootPrefixCls}-inline-collapsed-tooltip`, + }, + on: {}, + } return {$slots.default} diff --git a/components/menu/demo/horizontal.vue b/components/menu/demo/horizontal.vue index d46101a8f..b4859d25b 100644 --- a/components/menu/demo/horizontal.vue +++ b/components/menu/demo/horizontal.vue @@ -1,8 +1,11 @@