mirror of
https://github.com/imdap/ruoyi-plus-vben5.git
synced 2026-05-07 18:51:46 +08:00
feat: ApiSelect增加shouldFetch控制,在api请求之前的判断是否允许请求的回调函数 (#7713)
This commit is contained in:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user