From 0d3965281d41a67e62ae8a4e6e77062635ee6e5d Mon Sep 17 00:00:00 2001 From: webfansplz <308241863@qq.com> Date: Wed, 2 Nov 2022 22:02:57 +0800 Subject: [PATCH] fix(compiler-sfc): Resolve object expression parsing errors in `v-on` --- packages/compiler-sfc/src/compileScript.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 548fc592423..e9b747d5b77 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -1836,7 +1836,7 @@ function processExp(exp: string, isTS: boolean, dir?: string): string { if (dir === 'slot') { exp = `(${exp})=>{}` } else if (dir === 'on') { - exp = `()=>{${exp}}` + exp = `()=>{return ${exp}}` } else if (dir === 'for') { const inMatch = exp.match(forAliasRE) if (inMatch) {