feat:Form API 增加 setLoading,:用于非 Modal 中使用 Form 时,需要 Form 自己控制 loading 状态

pull/76/MERGE
YunaiV 2025-04-20 08:52:54 +08:00
parent 57c8d88bae
commit 19d5a3e258
1 changed files with 12 additions and 0 deletions

View File

@ -245,6 +245,18 @@ export class FormApi {
this.latestSubmissionValues = { ...toRaw(values) };
}
/**
* Modal 使 Form Form loading
* @author
* @param loading
*/
setLoading(loading: boolean) {
this.setState((prev) => ({
...prev,
submitButtonOptions: { ...prev.submitButtonOptions, loading },
}));
}
setState(
stateOrFn:
| ((prev: VbenFormProps) => Partial<VbenFormProps>)