From 0855352322b68a585b3910f41b21bcc1f2e25b7a Mon Sep 17 00:00:00 2001 From: DCloud_LXH <283700113@qq.com> Date: Thu, 14 Jul 2022 17:10:43 +0800 Subject: [PATCH] chore: handleEvent error parse --- src/core/runtime/wrapper/util.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/core/runtime/wrapper/util.js b/src/core/runtime/wrapper/util.js index d7d1ffb74..5e409ba9f 100644 --- a/src/core/runtime/wrapper/util.js +++ b/src/core/runtime/wrapper/util.js @@ -556,7 +556,9 @@ export function handleEvent (event) { } const handler = handlerCtx[methodName] if (!isFn(handler)) { - throw new Error(` _vm.${methodName} is not a function`) + const type = this.$vm.mpType === 'page' ? 'Page' : 'Component' + const path = this.route || this.is + throw new Error(`${type} "${path}" does not have a method "${methodName}"`) } if (isOnce) { if (handler.once) { -- GitLab