Skip to content

Commit 73be347

Browse files
committed
fix(compiler): prevent transforming v-slot with non-ObjectExpression
scope
1 parent 96409b0 commit 73be347

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/compiler/src/generators/component.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,8 @@ function genSlotBlockWithProps(oper: SlotBlockIRNode, context: CodegenContext) {
341341

342342
if (props) {
343343
rawProps = props.content
344-
if ((isDestructureAssignment = !!props.ast)) {
344+
if (props.ast?.type === 'ObjectExpression') {
345+
isDestructureAssignment = true
345346
;[depth, exitScope] = context.enterScope()
346347
propsName = `_slotProps${depth}`
347348
walkIdentifiers(

0 commit comments

Comments
 (0)