vue3在父组件的jsx代码中使用具名插槽我们可以使用v-slots
父组件
(h: any, scoped: any) => {
return (
<div class="tdesignbox">
<BasicButton
v-slots={
{
mount: () => {
return (
<>
<t-tooltip content="具名插槽绑定">
<t-button
shape="circle"
variant="text"
onClick={() => handleButton('mount', scoped.row)}
>
<MouseIcon />
</t-button>
</t-tooltip>
</>
)
}
}}
></BasicButton>
</div>
)
子组件
<template> <slot name="mount" /> </template>