1. Vue template 到 render 的过程
vue的模版编译过程主要如下:template -> ast -> render
函数
vue 在模版编译版本的码中会执行 compileToFunctions
将 template
转化为 render
函数:
// 将模板编译为render函数
const {
render, staticRenderFns } = compileToFunctions(template,options//省略}, this)
CompileToFunctions 中的主要逻辑如下∶
(1)调用 parse 方法将 template 转化为 ast(抽象语法树)
<