import { defineComponent } from 'vue';
const Slots1 = defineComponent({
setup(props, { slots }) {
return () => {
return (
<div>
aaa
{slots.foo?.({ val: 'val1' })}
</div>
);
};
}
});
export default defineComponent({
props: {
title: {
type: String,
default: ''
}
},
setup(props) {
return () => {
return (
<div class="watermark">
{props.title}
<Slots1>
{{
foo: ({ val }) => {
return <div>foo {val}</div>;
}
}}
</Slots1>
</div>
);
};
}
});
01-24
1256
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
06-14
1342
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)