From 478218ff11b188ccdba3566a01ca97b70b9c5c49 Mon Sep 17 00:00:00 2001 From: fxy060608 Date: Fri, 22 Apr 2022 18:17:15 +0800 Subject: [PATCH] fix(mp-weixin): input event compatible with async function (#3462) --- packages/uni-mp-vue/src/helpers/vOn.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/uni-mp-vue/src/helpers/vOn.ts b/packages/uni-mp-vue/src/helpers/vOn.ts index ee63b99b0..56f948252 100644 --- a/packages/uni-mp-vue/src/helpers/vOn.ts +++ b/packages/uni-mp-vue/src/helpers/vOn.ts @@ -5,6 +5,7 @@ import { hasOwn, NOOP, isString, + isPromise, } from '@vue/shared' import { callWithAsyncErrorHandling, @@ -94,7 +95,11 @@ function createInvoker( if (bubbles.includes(e.type) && !eventSync) { setTimeout(invoke) } else { - return invoke() + const res = invoke() + if (e.type === 'input' && isPromise(res)) { + return + } + return res } } invoker.value = initialValue -- GitLab