<a-select
v-model:value="editForm.insuranceCode"
style="width: 100%"
show-search
allowClear
placeholder="请选择"
@change="handleChange"
>
<a-select-option
v-for="item in options"
:key="item.insuranceCode"
:value="item.insuranceCode"
>
{{item.insuranceCode}}
</a-select-option>
</a-select>
<script setup lang="ts">
const options = ref([])
const handleChange = (value: any) => {
const selectedItem = options.value.find(item => item.insuranceCode === value);
editForm.value.insuranceCode = selectedItem.insuranceCode
editForm.value.insuranceCount = selectedItem.insuranceCount
editForm.value.insuranceId = selectedItem.insuranceId
};
</script>
AntDesign vue3 选择框传递多个参数
最新推荐文章于 2024-07-18 10:53:53 发布