feat(compiler): element codegen

This commit is contained in:
Evan You
2019-09-22 16:50:57 -04:00
parent 40307d9642
commit 3a177a18d2
15 changed files with 369 additions and 120 deletions

View File

@@ -3,6 +3,9 @@ import { transform, TransformOptions } from './transform'
import { generate, CodegenOptions, CodegenResult } from './codegen'
import { RootNode } from './ast'
import { isString } from '@vue/shared'
import { transformIf } from './transforms/vIf'
import { transformFor } from './transforms/vFor'
import { prepareElementForCodegen } from './transforms/element'
export type CompilerOptions = ParserOptions & TransformOptions & CodegenOptions
@@ -15,7 +18,9 @@ export function compile(
transform(ast, {
...options,
nodeTransforms: [
// TODO include built-in core transforms
transformIf,
transformFor,
prepareElementForCodegen,
...(options.nodeTransforms || []) // user transforms
],
directiveTransforms: {