| 7898 | |
| 7899 | //相同的输入类型。判断a和b的属性是否相同 |
| 7900 | function sameInputType(a, b) { |
| 7901 | if (a.tag !== 'input') { //如果a标签不是input |
| 7902 | return true |
| 7903 | } |
| 7904 | var i; |
| 7905 | var typeA = isDef(i = a.data) && isDef(i = i.attrs) && i.type; //获取a的tag标签属性 |
| 7906 | var typeB = isDef(i = b.data) && isDef(i = i.attrs) && i.type;//获取b的tag标签属性 |
| 7907 | return typeA === typeB || //typeA和typeB 都相同 |
| 7908 | //匹配'text,number,password,search,email,tel,url' |
| 7909 | isTextInputType(typeA) && isTextInputType(typeB) |
| 7910 | } |
| 7911 | |
| 7912 | // 创建key 如果没有key 则用索引作为key |
| 7913 | function createKeyToOldIdx(children, beginIdx, endIdx) { |