修复 spreadArray 报错问题

This commit is contained in:
liaoxuezhi 2019-10-22 21:54:41 +08:00
parent 0e7be89aa3
commit 976dff52b8

View File

@ -192,10 +192,10 @@ export function validate(
const fn = validations[ruleName];
if (!fn(values, value, ...rules[ruleName])) {
if (!fn(values, value, ...(Array.isArray(rules[ruleName]) ? rules[ruleName] : [rules[ruleName]]))) {
errors.push(
filter((messages && messages[ruleName]) || validateMessages[ruleName], {
...['', ...rules[ruleName]]
...[''].concat(rules[ruleName])
})
);
}