Commit ef0a1753 authored by chenshouchao's avatar chenshouchao

feat: 解决validators为空时流程图渲染不出来的问题

parent c88a7696
...@@ -20,14 +20,16 @@ export const getCheckResult = ( ...@@ -20,14 +20,16 @@ export const getCheckResult = (
helperText = "该选项是必填项"; helperText = "该选项是必填项";
} }
} }
if (parameter.validators.length > 0) { if (parameter?.validators) {
parameter.validators.forEach((validator) => { if (parameter.validators.length > 0) {
const reg = new RegExp(validator.regex); parameter.validators.forEach((validator) => {
if (!reg.test(value)) { const reg = new RegExp(validator.regex);
error = true; if (!reg.test(value)) {
helperText = validator.message; error = true;
} helperText = validator.message;
}); }
});
}
} }
return { return {
error, error,
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment