Skip to content

Commit

Permalink
➕修复单元测试
Browse files Browse the repository at this point in the history
  • Loading branch information
Foveluy committed Dec 24, 2017
1 parent 196aef6 commit c3f937f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
File renamed without changes.
8 changes: 6 additions & 2 deletions src/Luy/createElement.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,15 @@ export function flattenChildren(children: Array, parentVnode) {
if (typeNumber(item) === 4) {
item = new Vnode('#text', item, null, null)
} else {
if (item) {
item.return = parentVnode;
if (item) {//首先判断是否存在
if (typeNumber(item) !== 3 && typeNumber(item) !== 4) {//再判断是不是字符串,或者数字
//不是就加上return
item.return = parentVnode;
}
}
}
return item

})

return ary
Expand Down

0 comments on commit c3f937f

Please sign in to comment.