mirror of
https://github.com/woutdp/live_svelte
synced 2026-05-24 09:28:21 +00:00
Add support for the render function to render slots
This commit is contained in:
parent
3a881032ab
commit
40a0884390
1 changed files with 4 additions and 3 deletions
|
|
@ -1,4 +1,5 @@
|
|||
module.exports.render = (name, props={}) => {
|
||||
module.exports.render = (name, props={}, slots=null) => {
|
||||
const ssrComponent = require('../../priv/static/assets/server/server.js')[name].default
|
||||
return ssrComponent.render(props)
|
||||
}
|
||||
const $$slots = slots ? {default: () => slots} : {}
|
||||
return ssrComponent.render(props, {$$slots, context: new Map()})
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue