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>
);
};
}
});
vue3 jsx 使用插槽
最新推荐文章于 2024-05-30 13:59:14 发布