Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed May 9, 2017
1 parent ec70b44 commit dc00590
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/core/vdom/helpers/normalize-children.js
Expand Up @@ -52,13 +52,17 @@ function normalizeArrayChildren (children: any, nestedIndex?: string): Array<VNo
res.push.apply(res, normalizeArrayChildren(c, `${nestedIndex || ''}_${i}`))
} else if (isPrimitive(c)) {
if (isTextNode(last)) {
// merge adjacent text nodes
// this is necessary for SSR hydration because text nodes are
// essentially merged when rendered to HTML strings
(last: any).text += String(c)
} else if (c !== '') {
// convert primitive to vnode
res.push(createTextVNode(c))
}
} else {
if (isTextNode(c) && isTextNode(last)) {
// merge adjacent text nodes
res[res.length - 1] = createTextVNode(last.text + c.text)
} else {
// default key for nested array children (likely generated by v-for)
Expand Down

0 comments on commit dc00590

Please sign in to comment.