From eb68438047c90a752ad5ea33b7877d54feab1e14 Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Thu, 28 Apr 2022 17:34:53 +0800 Subject: [PATCH] fix: click event error question/144073 --- packages/uni-core/src/view/plugin/componentWxs.ts | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/packages/uni-core/src/view/plugin/componentWxs.ts b/packages/uni-core/src/view/plugin/componentWxs.ts index b0c437605..61da68cdd 100644 --- a/packages/uni-core/src/view/plugin/componentWxs.ts +++ b/packages/uni-core/src/view/plugin/componentWxs.ts @@ -4,6 +4,7 @@ import { isPlainObject, parseStringStyle, stringifyStyle, + hasOwn, } from '@vue/shared' import { ON_WXS_INVOKE_CALL_METHOD, @@ -270,11 +271,14 @@ export function wrapperH5WxsEvent( checkArgsLength = true ) { if (eventValue) { - Object.defineProperty(event, 'instance', { - get() { - return getComponentDescriptor(instance!.proxy!, false) - }, - }) + if (!event.__instance) { + event.__instance = true + Object.defineProperty(event, 'instance', { + get() { + return getComponentDescriptor(instance!.proxy!, false) + }, + }) + } const ownerVm = resolveOwnerComponentPublicInstance( eventValue, instance!, -- GitLab