feat(sfc): wip scopeId compiler support

This commit is contained in:
Evan You
2019-12-16 12:11:51 -05:00
parent b2c2d0590e
commit 51980afca2
8 changed files with 107 additions and 22 deletions

View File

@@ -119,6 +119,16 @@ function createTransformContext(
}: TransformOptions
): TransformContext {
const context: TransformContext = {
// options
prefixIdentifiers,
hoistStatic,
cacheHandlers,
nodeTransforms,
directiveTransforms,
isBuiltInComponent,
onError,
// state
root,
helpers: new Set(),
components: new Set(),
@@ -133,16 +143,11 @@ function createTransformContext(
vPre: 0,
vOnce: 0
},
prefixIdentifiers,
hoistStatic,
cacheHandlers,
nodeTransforms,
directiveTransforms,
isBuiltInComponent,
onError,
parent: null,
currentNode: root,
childIndex: 0,
// methods
helper(name) {
context.helpers.add(name)
return name