设置:filterOption 属性为false
vben admin框架中封装了ant design vue
select组件在使用提供的updaeSchema
函数时只能更新一次,有知道解决的老铁可以告诉我.代码如下:
{
field: 'package',
label: '套餐项目',
component: 'ApiSelect',
componentProps: ({ formActionType })=>{
const fetchData = ref<OptionsItem[]>([]);
const fetchTest = debounce(values=>{
console.log('test:', values);
const httpData = {
c_id: 1,
param: values
};
getchildrenTest(httpData).then(res => {
console.log('res:', res);
const item = res.map(test=> {
return {
label: `${test.name}`,
value: test.id,
}});
fetchData.value = item;
})
},1000);
watch(()=>fetchData.value,()=>{
console.log('fetchData):',fetchData.value);
formActionType.updateSchema([{
field:'package',
componentProps:{
options:fetchData.value,
showSearch: true,
filterOption:false,
mode: 'multiple',
},
}]);
})
return{
// api: getchildrenTest,
labelField: 'name',
valueField: 'id',
showSearch: true,
mode: 'multiple',
onSearch: fetchTest,
// params:{c_id: 1},
filterOption: false,
// filterOption: (input,options)=>{
// return options?.label.toLowerCase().indexOf(input.toLowerCase()) >=0;
// },
}
},
colProps: { span: 24 },
},