Quellcode durchsuchen

fix(compiler-sfc): fix expression check for v-on with object literal value (#6652)

fix #6650
fix #6674
Travis vor 3 Jahren
Ursprung
Commit
6958ec1b37
1 geänderte Dateien mit 1 neuen und 1 gelöschten Zeilen
  1. 1 1
      packages/compiler-sfc/src/compileScript.ts

+ 1 - 1
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) {