Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/core/vdom/helpers/normalize-children.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ function normalizeArrayChildren (children: any, nestedIndex?: string): Array<VNo
let i, c, last
for (i = 0; i < children.length; i++) {
c = children[i]
if (c == null) continue
if (c == null || typeof c === 'boolean') continue
last = res[res.length - 1]
// nested
if (Array.isArray(c)) {
Expand Down
11 changes: 11 additions & 0 deletions test/unit/modules/vdom/create-element.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,17 @@ describe('create-element', () => {
expect(vnode.children[2].tag).toBe('br')
})

it('render vnode with children, including boolean and null type', () => {
const vm = new Vue({})
const h = vm.$createElement
const vnode = h('p', [h('br'), true, 123, h('br'), 'abc', null])
expect(vnode.children.length).toBe(4)
expect(vnode.children[0].tag).toBe('br')
expect(vnode.children[1].text).toBe('123')
expect(vnode.children[2].tag).toBe('br')
expect(vnode.children[3].text).toBe('abc')
})

it('render svg elements with correct namespace', () => {
const vm = new Vue({})
const h = vm.$createElement
Expand Down