From 6958ec1b37fb4a9244ae222a35fcac032d26ad8a Mon Sep 17 00:00:00 2001 From: Travis Date: Tue, 27 Sep 2022 17:30:10 +0800 Subject: [PATCH] fix(compiler-sfc): fix expression check for v-on with object literal value (#6652) fix #6650 fix #6674 --- 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 5a77e8a9463..a21f94cba71 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) {