]> git.ipfire.org Git - thirdparty/vuejs/core.git/commitdiff
fix(compiler-sfc): fix expression check for v-on with object literal value (#6652)
authorTravis <godxiaoji@163.com>
Tue, 27 Sep 2022 09:30:10 +0000 (17:30 +0800)
committerGitHub <noreply@github.com>
Tue, 27 Sep 2022 09:30:10 +0000 (05:30 -0400)
fix #6650
fix #6674

packages/compiler-sfc/src/compileScript.ts

index 5a77e8a946300327f810c2a6691f1a791ecca967..a21f94cba7137ddc72eab2b2c650c378d0a8d792 100644 (file)
@@ -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) {