Fixed #7006 - @primevue/forms: Form components submit event parameter missing values
parent
f481158d36
commit
803e8575b3
|
@ -185,11 +185,9 @@ export const useForm = (options = {}) => {
|
||||||
{ names: [], values: {} }
|
{ names: [], values: {} }
|
||||||
);
|
);
|
||||||
|
|
||||||
let result =
|
const [names, values] = [resolverOptions.names, groupKeys(resolverOptions.values)];
|
||||||
(await options.resolver?.({
|
|
||||||
names: resolverOptions.names,
|
let result = (await options.resolver?.({ names, values })) ?? { values };
|
||||||
values: groupKeys(resolverOptions.values)
|
|
||||||
})) ?? {};
|
|
||||||
|
|
||||||
result.errors ??= {};
|
result.errors ??= {};
|
||||||
|
|
||||||
|
@ -201,7 +199,7 @@ export const useForm = (options = {}) => {
|
||||||
|
|
||||||
if (fieldResolver) {
|
if (fieldResolver) {
|
||||||
const fieldValue = fieldInst.states.value;
|
const fieldValue = fieldInst.states.value;
|
||||||
const fieldResult = (await fieldResolver({ values: fieldValue, value: fieldValue, name: fieldName })) ?? {};
|
const fieldResult = (await fieldResolver({ values: fieldValue, value: fieldValue, name: fieldName })) ?? { values: fieldValue };
|
||||||
|
|
||||||
isArray(fieldResult.errors) && (fieldResult.errors = { [fieldName]: fieldResult.errors });
|
isArray(fieldResult.errors) && (fieldResult.errors = { [fieldName]: fieldResult.errors });
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue