fix(compiler-sfc): Resolve object expression parsing errors in v-on (#12862)

This commit is contained in:
webfansplz 2023-10-23 15:08:58 +08:00 committed by GitHub
parent d27c128b7c
commit b8c8b3fc7a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1841,7 +1841,7 @@ function processExp(exp: string, isTS: boolean, dir?: string): string {
if (dir === 'slot') { if (dir === 'slot') {
exp = `(${exp})=>{}` exp = `(${exp})=>{}`
} else if (dir === 'on') { } else if (dir === 'on') {
exp = `()=>{${exp}}` exp = `()=>{return ${exp}}`
} else if (dir === 'for') { } else if (dir === 'for') {
const inMatch = exp.match(forAliasRE) const inMatch = exp.match(forAliasRE)
if (inMatch) { if (inMatch) {