From 520d6a5e85eb391e5294211c9d7b2ea598c59119 Mon Sep 17 00:00:00 2001 From: tanjinzhou <415800467@qq.com> Date: Tue, 8 Dec 2020 11:50:52 +0800 Subject: [PATCH] perf: menu warning error --- components/vc-menu/MenuItem.jsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/vc-menu/MenuItem.jsx b/components/vc-menu/MenuItem.jsx index 0750b1178..e2dfaaf91 100644 --- a/components/vc-menu/MenuItem.jsx +++ b/components/vc-menu/MenuItem.jsx @@ -4,7 +4,7 @@ import BaseMixin from '../_util/BaseMixin'; import scrollIntoView from 'dom-scroll-into-view'; import { noop, menuAllProps } from './util'; import { getComponent, getSlot, findDOMNode } from '../_util/props-util'; -import { computed, defineComponent, inject, onBeforeUnmount, onMounted } from 'vue'; +import { computed, defineComponent, inject, onBeforeUnmount, onMounted, toRaw } from 'vue'; import InjectExtraProps from './InjectExtraProps'; const props = { attribute: PropTypes.object, @@ -119,7 +119,7 @@ const MenuItem = defineComponent({ const info = { key: eventKey, keyPath: [eventKey], - item: this, + item: { ...toRaw(this.$props), isSelected }, domEvent: e, };