MCPcopy
hub / github.com/ygs-code/vue / getFirstComponentChild

Function getFirstComponentChild

vue.js:3579–3589  ·  view source on GitHub ↗
(children)

Source from the content-addressed store, hash-verified

3577 * */
3578
3579 function getFirstComponentChild(children) {
3580 if (Array.isArray(children)) { //如果组件是个数组
3581 for (var i = 0; i < children.length; i++) { //循环子组件
3582 var c = children[i];
3583 //如果子组件存在,并且子组件有options参数,不是空组件的,并且是异步组件的
3584 if (isDef(c) && (isDef(c.componentOptions) || isAsyncPlaceholder(c))) {
3585 return c
3586 }
3587 }
3588 }
3589 }
3590
3591
3592 /*

Callers 2

vue.jsFile · 0.85
getRealChildFunction · 0.85

Calls 2

isDefFunction · 0.85
isAsyncPlaceholderFunction · 0.85

Tested by

no test coverage detected