mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-12-21 04:50:14 +08:00
fix(form): lint
This commit is contained in:
parent
b44901e111
commit
71ec0cb47a
@ -66,7 +66,7 @@ export default defineComponent({
|
||||
validateCallback?: FormValidateCallback,
|
||||
shouldRuleBeApplied: ApplyRule = () => true
|
||||
): Promise<void> {
|
||||
return new Promise((resolve, reject) => {
|
||||
return await new Promise((resolve, reject) => {
|
||||
const formItemValidationPromises = []
|
||||
for (const key of keysOf(formItems)) {
|
||||
const formItemInstances = formItems[key]
|
||||
|
@ -297,20 +297,20 @@ export default defineComponent({
|
||||
return shallowClonedRule
|
||||
})
|
||||
if (!activeRules.length) {
|
||||
return Promise.resolve({
|
||||
return await Promise.resolve({
|
||||
valid: true
|
||||
})
|
||||
}
|
||||
const mergedPath = path ?? '__n_no_path__'
|
||||
const validator = new Schema({ [mergedPath]: activeRules as RuleItem[] })
|
||||
return new Promise((resolve) => {
|
||||
return await new Promise((resolve) => {
|
||||
void validator.validate(
|
||||
{ [mergedPath]: value },
|
||||
options,
|
||||
(errors, fields) => {
|
||||
if (errors?.length) {
|
||||
explainsRef.value = errors.map(
|
||||
(error: ValidateError) => error?.message ?? ''
|
||||
(error: ValidateError) => error?.message || ''
|
||||
)
|
||||
validationErroredRef.value = true
|
||||
resolve({
|
||||
|
Loading…
Reference in New Issue
Block a user