MCPcopy Index your code
hub / github.com/ygs-code/vue / insert

Function insert

vue.js:8293–8307  ·  view source on GitHub ↗
(
            parent,//父真实dom
            elm,//当前vonde的真实dom
            ref$$1 // 当前vonde的真实dom的兄弟节点或者不是
        )

Source from the content-addressed store, hash-verified

8291 //插入一个真实的dom,如果ref$$1.parentNode等于parent是。ref$$1和elm他们是兄弟节点则插入ref$$1前面
8292 //如果ref$$1的ref$$1.parentNode不等于parent。那么elm就直接append到parent中
8293 function insert(
8294 parent,//父真实dom
8295 elm,//当前vonde的真实dom
8296 ref$$1 // 当前vonde的真实dom的兄弟节点或者不是
8297 ) {
8298 if (isDef(parent)) {
8299 if (isDef(ref$$1)) {
8300 if (ref$$1.parentNode === parent) {
8301 nodeOps.insertBefore(parent, elm, ref$$1);
8302 }
8303 } else {
8304 nodeOps.appendChild(parent, elm);
8305 }
8306 }
8307 }
8308
8309 //创建子节点
8310 function createChildren(

Callers 2

createElmFunction · 0.85
reactivateComponentFunction · 0.85

Calls 1

isDefFunction · 0.85

Tested by

no test coverage detected