Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiller1990 authored and cexbrayat committed Jul 8, 2021
1 parent 16fe208 commit 55b4707
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/mount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ export function mount(
function slotToFunction(slot: Slot) {
if (typeof slot === 'object') {
if ('render' in slot && slot.render) {
return slot.render
return () => h(slot)
}

if ('template' in slot && slot.template) {
Expand Down
11 changes: 10 additions & 1 deletion tests/mountingOptions/slots.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ describe('slots', () => {
'' +
'<div class="named">' +
'<div id="root">' +
'<div id="msg"></div>' +
'<div id="msg">Hello world</div>' +
'</div>' +
'</div>'
)
Expand Down Expand Up @@ -214,16 +214,25 @@ describe('slots', () => {
const Parent = defineComponent({
mounted() {
parentMounted()
},
render() {
return h(this.$slots.default!)
}
})

const Child = defineComponent({
render() {
return h('span')
},
mounted() {
childMounted()
}
})

const wrapper = mount(Parent, {
global: {
components: { Child }
},
slots: {
default: Child
}
Expand Down

0 comments on commit 55b4707

Please sign in to comment.