JSFiddle - React, Tailwind, and code Playground
by skirtle
HTML
<script src="https://unpkg.com/[email protected]/dist/vue.global.js"></script>
<div id="app"></div>
JavaScript
const { createApp, h } = Vue
const PageComponent = {
template: `
<div>
<slot name="header">
<h1>Default header</h1>
</slot>
<div>Content of the page</div>
</div>
`
}
createApp({
render () {
return h(PageComponent, null, {
header () {
return h('div', 'Overwrite "header" slot with this content in PageComponent')
}
})
}
}).mount('#app')