fix(compiler-sfc): support runtime Enum in normal script (#4698)

This commit is contained in:
edison
2021-10-08 23:57:39 +08:00
committed by GitHub
parent 914e2e3880
commit f66d456b7a
3 changed files with 42 additions and 1 deletions

View File

@@ -834,7 +834,8 @@ export function compileScript(
} else if (
(node.type === 'VariableDeclaration' ||
node.type === 'FunctionDeclaration' ||
node.type === 'ClassDeclaration') &&
node.type === 'ClassDeclaration' ||
node.type === 'TSEnumDeclaration') &&
!node.declare
) {
walkDeclaration(node, scriptBindings, userImportAlias)
@@ -1504,6 +1505,7 @@ function walkDeclaration(
}
}
} else if (
node.type === 'TSEnumDeclaration' ||
node.type === 'FunctionDeclaration' ||
node.type === 'ClassDeclaration'
) {