代码如下(示例):
<template #[item]="data" v-for="item in ['model1','model2']">
<slot :name="item" v-bind="data || {}">
// 这是写上插槽的内容,比如input
<a-input v-model:value="data.model[item]" />
</slot>
</template>
代码如下(示例):
<template #[item]="data" v-for="item in ['model1','model2']">
<slot :name="item" v-bind="data || {}">
// 这是写上插槽的内容,比如input
<a-input v-model:value="data.model[item]" />
</slot>
</template>