mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-01-24 02:00:22 +08:00
feat(form): requires Increase function type value (#649)
* feat(form): requires Increase function type value * feat(form): requires Increase function type value * fix(form): 修复 rules 赋值错误的问题
This commit is contained in:
parent
bbf178f64b
commit
765064a190
@ -174,8 +174,12 @@
|
||||
return Promise.resolve();
|
||||
}
|
||||
|
||||
if ((!rules || rules.length === 0) && required) {
|
||||
rules = [{ required, validator }];
|
||||
const getRequired = isFunction(required)
|
||||
? required(unref(getValues))
|
||||
: required;
|
||||
|
||||
if ((!rules || rules.length === 0) && getRequired) {
|
||||
rules = [{ required: getRequired, validator }];
|
||||
}
|
||||
|
||||
const requiredRuleIndex: number = rules.findIndex(
|
||||
|
@ -149,7 +149,7 @@ export interface FormSchema {
|
||||
}) => Recordable)
|
||||
| object;
|
||||
// Required
|
||||
required?: boolean;
|
||||
required?: boolean | ((renderCallbackParams: RenderCallbackParams) => boolean);
|
||||
|
||||
suffix?: string | number | ((values: RenderCallbackParams) => string | number);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user