未验证 提交 e689ee5f 编写于 作者: 最后 提交者: GitHub

Update useFormEvents.ts (#514)

fix: 修复 表单回显时,参数为null或者''时, 报Invalid date的错
上级 f4af2311
......@@ -67,13 +67,13 @@ export function useFormEvents({
// time type
if (itemIsDateType(key)) {
if (Array.isArray(value)) {
const arr: moment.Moment[] = [];
const arr: any[] = [];
for (const ele of value) {
arr.push(dateUtil(ele));
arr.push(ele ? dateUtil(ele) : null);
}
formModel[key] = arr;
} else {
formModel[key] = dateUtil(value);
formModel[key] = value ? dateUtil(value) : null;
}
} else {
formModel[key] = value;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册