|
|
@@ -52,6 +52,9 @@ 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
|
|
|
@@ -59,6 +62,7 @@ function normalizeArrayChildren (children: any, nestedIndex?: string): Array<VNo
|
|
|
}
|
|
|
} 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)
|