Skip to content

Commit b8c8b3f

Browse files
authored
fix(compiler-sfc): Resolve object expression parsing errors in v-on (#12862)
1 parent d27c128 commit b8c8b3f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/compiler-sfc/src/compileScript.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1841,7 +1841,7 @@ function processExp(exp: string, isTS: boolean, dir?: string): string {
18411841
if (dir === 'slot') {
18421842
exp = `(${exp})=>{}`
18431843
} else if (dir === 'on') {
1844-
exp = `()=>{${exp}}`
1844+
exp = `()=>{return ${exp}}`
18451845
} else if (dir === 'for') {
18461846
const inMatch = exp.match(forAliasRE)
18471847
if (inMatch) {

0 commit comments

Comments
 (0)