Skip to content

Commit e604f1c

Browse files
committed
fix: render all children
1 parent 236ab92 commit e604f1c

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

packages/shared/stub-components.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ export function createBlankStub (
124124
...this.$props
125125
}
126126
},
127-
context ? context.children : this.$slots.default
127+
context ? context.children : this.$options._renderChildren
128128
)
129129
}
130130
}

test/specs/shallow-mount.spec.js

+19
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,25 @@ describeRunIf(process.env.TEST_ENV !== 'node', 'shallowMount', () => {
7777
expect(wrapper.html()).to.equal('<child-stub>Hello</child-stub>')
7878
})
7979

80+
it('renders named slots', () => {
81+
const localVue = createLocalVue()
82+
localVue.component('child', {
83+
template: '<div />'
84+
})
85+
const TestComponent = {
86+
template: `
87+
<child>
88+
<p slot="header">Hello</p>
89+
<p slot="footer">World</p>
90+
</child>
91+
`
92+
}
93+
const wrapper = shallowMount(TestComponent, {
94+
localVue
95+
})
96+
expect(wrapper.html()).to.equal('<child-stub><p>Hello</p> <p>World</p></child-stub>')
97+
})
98+
8099
it('renders no children if none supplied', () => {
81100
const TestComponent = {
82101
template: '<child />',

0 commit comments

Comments
 (0)