fix(reactivity-transform): apply transform for labelled variable declarations

ref https://github.com/vuejs/core/issues/5298#issuecomment-1017970061
This commit is contained in:
Evan You
2022-01-21 07:48:41 +08:00
parent a81a9922bb
commit a05b000948
3 changed files with 15 additions and 4 deletions

View File

@@ -235,6 +235,11 @@ export function transformAST(
stmt.declaration.type === 'VariableDeclaration'
) {
walkVariableDeclaration(stmt.declaration, isRoot)
} else if (
stmt.type === 'LabeledStatement' &&
stmt.body.type === 'VariableDeclaration'
) {
walkVariableDeclaration(stmt.body, isRoot)
}
}
}