Просмотр исходного кода

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

fix #6650
fix #6674
Travis 3 лет назад
Родитель
Сommit
6958ec1b37
1 измененных файлов с 1 добавлено и 1 удалено
  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) {