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

Function normalizeChildren

vue.js:3305–3311  ·  view source on GitHub ↗
(children)

Source from the content-addressed store, hash-verified

3303 // is needed to cater to all possible types of children values. 需要满足所有可能的儿童价值类型。
3304 //判断children的数据类型 而创建不同的虚拟dom vonde
3305 function normalizeChildren(children) {
3306 return isPrimitive(children) ? //判断数据类型是否是string,number,symbol,boolean
3307 [createTextVNode(children)] // 创建一个文本节点
3308 : Array.isArray(children) ? //判断是否是数组
3309 normalizeArrayChildren(children) //创建一个规范的子节点数组。
3310 : undefined
3311 }
3312
3313 //判断是否是文本节点
3314 function isTextNode(node) {

Callers 2

_createElementFunction · 0.85

Calls 3

isPrimitiveFunction · 0.85
createTextVNodeFunction · 0.85
normalizeArrayChildrenFunction · 0.85

Tested by

no test coverage detected