Vue模版编译

匿名 (未验证) 提交于 2019-12-03 00:11:01

 

一 模版文件

 

<div>   <header>     <h1>I'm a template!</h1>   </header>   <p v-if="message">{{ message }}</p>   <p v-else>No message.</p> </div>

 

二 渲染函数(render)

 

function anonymous() {   with (this) {     return _c("div", [         // header部分         _m(0),         // if-else部分         message ?              _c("p", [_v(_s(message))]) :              _c("p", [_v("No message.")])     ]);   } }

 

三 静态渲染函数(staticRenderFns)

 

_m(0): function anonymous() {   with (this) {     return _c("header", [         _c("h1", [             _v("I'm a template!")         ])     ]);   } }

 

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!