MCPcopy Create free account
hub / github.com/ygs-code/vue / genStatic

Function genStatic

vue.js:14803–14812  ·  view source on GitHub ↗
(el, state)

Source from the content-addressed store, hash-verified

14801 // hoist static sub-trees out 将静态子树吊出
14802 //将子节点导出虚拟dom 渲染函数的参数形式
14803 function genStatic(el, state) {
14804 //标记已经处理过
14805 el.staticProcessed = true;
14806 //添加渲染函数
14807 //genElement根据el判断是否是组件,或者是否含有v-once,v-if,v-for,是否有template属性,或者是slot插槽,转换style,css等转换成虚拟dom需要渲染的参数函数
14808 state.staticRenderFns.push(("with(this){return " + (genElement(el, state)) + "}"));
14809
14810 //返回虚拟dom渲染需要的参数格式
14811 return ("_m(" + (state.staticRenderFns.length - 1) + (el.staticInFor ? ',true' : '') + ")")
14812 }
14813
14814 // v-once
14815 //文档https://cn.vuejs.org/v2/api/#v-once

Callers 2

genElementFunction · 0.85
genOnceFunction · 0.85

Calls 1

genElementFunction · 0.85

Tested by

no test coverage detected