fix(compiler-sfc): fix object default values for reactive props destructure

This commit is contained in:
Evan You
2022-05-10 08:39:27 +08:00
parent 0683a022ec
commit 7dfe146096
3 changed files with 9 additions and 9 deletions

View File

@@ -735,7 +735,7 @@ export function compileScript(
destructured.default.end!
)
const isLiteral = destructured.default.type.endsWith('Literal')
return isLiteral ? value : `() => ${value}`
return isLiteral ? value : `() => (${value})`
}
}