Skip to content
Merged
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
14 changes: 10 additions & 4 deletions src/guide/render-function.md
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,15 @@ To pass slots to a child component using render functions:
render() {
// `<div><child v-slot="props"><span>{{ props.text }}</span></child></div>`
return Vue.h('div', [
Vue.h('child', {}, {
Vue.h(
Vue.resolveComponent('child'),
{},
// pass `slots` as the children object
// in the form of { name: props => VNode | Array<VNode> }
default: (props) => Vue.h('span', props.text)
})
{
default: (props) => Vue.h('span', props.text)
}
)
])
}
```
Expand All @@ -389,7 +393,9 @@ Vue.h(
{
level: 1
},
[Vue.h('span', 'Hello'), ' world!']
{
default: () => [Vue.h('span', 'Hello'), ' world!']
}
)
```

Expand Down