未验证 提交 9a21b8b6 编写于 作者: L Liu Ya 提交者: GitHub

fix(form): Improve form error handling

* 自定义组件 Array 的元素可能为 null

* 自定义组件时没有抛出错误
上级 663d13a6
......@@ -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
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册