mirror of
https://github.com/vbenjs/vben-admin-thin-next.git
synced 2025-01-24 02:00:22 +08:00
fix(form): Improve form error handling
* 自定义组件 Array 的元素可能为 null * 自定义组件时没有抛出错误
This commit is contained in:
parent
663d13a67f
commit
9a21b8b6a4
@ -212,7 +212,9 @@ export function useFormEvents({
|
||||
const values = await validate();
|
||||
const res = handleFormValues(values);
|
||||
emit('submit', res);
|
||||
} catch (error) {}
|
||||
} catch (error) {
|
||||
throw new Error(error);
|
||||
}
|
||||
}
|
||||
|
||||
return {
|
||||
|
@ -35,7 +35,7 @@ export function useFormValues({
|
||||
if (isObject(value)) {
|
||||
value = transformDateFunc(value);
|
||||
}
|
||||
if (isArray(value) && value[0]._isAMomentObject && value[1]._isAMomentObject) {
|
||||
if (isArray(value) && value[0]?._isAMomentObject && value[1]?._isAMomentObject) {
|
||||
value = value.map((item) => transformDateFunc(item));
|
||||
}
|
||||
// Remove spaces
|
||||
|
Loading…
Reference in New Issue
Block a user