naive-ui的n-input举例
<template>
<n-input
clearable
placeholder=""
v-bind="$attrs"
>
<template v-for="(value, name) in $slots" #[name] = "slotData">
<slot :name="name" v-bind="slotData || {}"></slot>
</template>
</n-input>
</template>
//import { useAttrs, useSlots } from 'vue'
//const slots = useSlots()
//const attrs = useAttrs()
<script lang='ts' setup>
</script>
<style scoped lang='less'>
</style>