Skip to content

Commit

Permalink
simplify createNodeFromVNode by using existing appendChild utility
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed May 6, 2017
1 parent 3def907 commit f441791
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 15 deletions.
9 changes: 2 additions & 7 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -376,18 +376,13 @@
} else {
// Add all children
for (var i = 0; i < vnode.children.length; i++) {
var childVNode = vnode.children[i];
var childNode = createNodeFromVNode(vnode.children[i], instance);
el.appendChild(childNode);
// Component detected, mount it here
if (childVNode.meta.component !== undefined) {
createComponentFromVNode(childNode, childVNode, childVNode.meta.component);
}
appendChild(createNodeFromVNode(vnode.children[i], instance), vnode.children[i], el);
}
}
// Add all event listeners
addEventListeners(el, vnode, instance);
}

// Setup Props
diffProps(el, {}, vnode, vnode.props.attrs);

Expand Down
Loading

0 comments on commit f441791

Please sign in to comment.