vue-modal
vue-modal copied to clipboard
How can I pass the slot
pass vue component slot
Hello, just transferring to the slot will not work. I prefer to create modal windows with the required slots. It looks something like this:
// other-component.vue
<widget-modal>
<template #header> Test {{label}}</template>
</widget-modal>
And then
import OtherComponent from "./other-component.vue"
openModal(OtherComponent, { label: "Header" })
Also u can try to do something like this:
openModal({
template: `
<widget-modal>
<template #header> Test {{label}}</template>
</widget-modal>
`,
components: {WidgetModal}
}, { label: "Header" })
It looks like additionally bridging a component to pass the slot. It a little trouble. Is there a simple better way to achieve it?