diff --git a/packages/shared/stub-components.js b/packages/shared/stub-components.js index cd27a4f4a..3cc1ba207 100644 --- a/packages/shared/stub-components.js +++ b/packages/shared/stub-components.js @@ -99,10 +99,10 @@ function createBlankStub ( return { ...getCoreProperties(componentOptions), - render (h) { + render (h, context) { return h( tagName, - !componentOptions.functional && this.$slots.default + context ? context.children : this.$slots.default ) } } diff --git a/test/specs/shallow-mount.spec.js b/test/specs/shallow-mount.spec.js index 21481c993..3b486bc27 100644 --- a/test/specs/shallow-mount.spec.js +++ b/test/specs/shallow-mount.spec.js @@ -63,6 +63,44 @@ describeRunIf(process.env.TEST_ENV !== 'node', 'shallowMount', () => { expect(console.info.callCount).to.equal(4) }) + it('renders children', () => { + const localVue = createLocalVue() + localVue.component('child', { + template: '
' + }) + const TestComponent = { + template: `