【issues/435】代码生成的日期控件赋默认值报错,判断一下,浏览器提示警告

pull/474/head
zhangdaiscott 2023-04-10 21:06:21 +08:00
parent f9c999ae2f
commit eae59a5501
1 changed files with 9 additions and 1 deletions

View File

@ -117,7 +117,15 @@
const { defaultValue, component, componentProps } = schema;
// handle date type
if (defaultValue && dateItemType.includes(component)) {
const { valueFormat } = componentProps
//update-begin---author:wangshuai ---date:20230410 forissues/435------------
let valueFormat:string = "";
if(componentProps){
valueFormat = componentProps?.valueFormat;
}
if(!valueFormat){
console.warn("未配置valueFormat,可能导致格式化错误!");
}
//update-end---author:wangshuai ---date:20230410 forissues/435------------
if (!Array.isArray(defaultValue)) {
//update-begin---author:wangshuai ---date:20221124 for[issues/215]------------
if(valueFormat){