I'd like to do the following, but with Vue 2's render function
<template>
<imported-component>
<template v-slot:default="{ importedFunction }">
<button @click="importedFunction">Do something</button>
</template>
</import-component>
</template>
scopedSlots for the sloton for the event handlerrender(h) {
return h('imported-component', {
scopedSlots: {
default(slotProps) {
return h('button', {
on: {
click: slotProps.importedFunction
}
}, 'Do something')
}
}
});
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With