feat: ApiSelect增加shouldFetch控制,在api请求之前的判断是否允许请求的回调函数 (#7713)

This commit is contained in:
xueyitt
2026-03-24 10:22:02 +08:00
committed by GitHub
parent 2aced2f659
commit 47a853330d
2 changed files with 17 additions and 1 deletions

View File

@@ -113,6 +113,10 @@ const [BaseForm, baseFormApi] = useVbenForm({
params: {
keyword: keyword.value || undefined,
},
// 远程搜索判断。当为true时才允许调用api
shouldFetch: (params: any) => {
return !!params?.keyword;
},
showSearch: true,
};
},
@@ -120,6 +124,7 @@ const [BaseForm, baseFormApi] = useVbenForm({
fieldName: 'remoteSearch',
// 界面显示的label
label: '远程搜索',
help: '远程查询,仅有输入时方进行查询',
renderComponentContent: () => {
return {
notFoundContent: fetching.value ? h(Spin) : undefined,