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/create-element.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ export function _createElement (
// direct component options / constructor
vnode = createComponent(tag, data, context, children)
}
if (vnode !== undefined) {
if (isDef(vnode)) {
if (ns) applyNS(vnode, ns)
return vnode
} else {
Expand Down
18 changes: 18 additions & 0 deletions test/unit/features/options/functional.spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import Vue from 'vue'
import { createEmptyVNode } from 'core/vdom/vnode'

describe('Options functional', () => {
it('should work', done => {
Expand Down Expand Up @@ -167,4 +168,21 @@ describe('Options functional', () => {
vm.$destroy()
}).then(done)
})

it('create empty vnode when render return null', () => {
const child = {
functional: true,
render () {
return null
}
}
const vm = new Vue({
components: {
child
}
})
const h = vm.$createElement
const vnode = h('child')
expect(vnode).toEqual(createEmptyVNode())
})
})