From: Travis Date: Tue, 27 Sep 2022 09:30:10 +0000 (+0800) Subject: fix(compiler-sfc): fix expression check for v-on with object literal value (#6652) X-Git-Tag: v3.2.40~11 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6958ec1b37fb4a9244ae222a35fcac032d26ad8a;p=thirdparty%2Fvuejs%2Fcore.git fix(compiler-sfc): fix expression check for v-on with object literal value (#6652) fix #6650 fix #6674 --- diff --git a/packages/compiler-sfc/src/compileScript.ts b/packages/compiler-sfc/src/compileScript.ts index 5a77e8a946..a21f94cba7 100644 --- a/packages/compiler-sfc/src/compileScript.ts +++ b/packages/compiler-sfc/src/compileScript.ts @@ -2135,7 +2135,7 @@ function processExp(exp: string, 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) {