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

Function sameVnode

vue.js:7880–7897  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

7878
7879 //sameVnode(oldVnode, vnode)2个节点的基本属性相同,那么就进入了2个节点的diff过程。
7880 function sameVnode(a, b) {
7881 return (
7882
7883 a.key === b.key && ( //如果a的key 等于b的key
7884 (
7885
7886 a.tag === b.tag && // 如果a的tag 等于b的tag
7887 a.isComment === b.isComment && // 如果a和b 都是注释节点
7888 isDef(a.data) === isDef(b.data) && //如果a.data 和 b.data 都定义后,是组件,或者是都含有tag属性
7889 sameInputType(a, b) //相同的输入类型。判断a和b的属性是否相同
7890 ) || (
7891 isTrue(a.isAsyncPlaceholder) && //判断是否是异步的
7892 a.asyncFactory === b.asyncFactory &&
7893 isUndef(b.asyncFactory.error)
7894 )
7895 )
7896 )
7897 }
7898
7899 //相同的输入类型。判断a和b的属性是否相同
7900 function sameInputType(a, b) {

Callers 3

updateChildrenFunction · 0.85
findIdxInOldFunction · 0.85
createPatchFunctionFunction · 0.85

Calls 4

isDefFunction · 0.85
sameInputTypeFunction · 0.85
isTrueFunction · 0.85
isUndefFunction · 0.85

Tested by

no test coverage detected