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

@@ -8,7 +8,7 @@ function compileToFunction(
options?: CompilerOptions
): RenderFunction {
const { code } = compile(template, options)
return new Function(`with(this){return ${code}}`) as RenderFunction
return new Function(code)() as RenderFunction
}
registerRuntimeCompiler(compileToFunction)