修复 spreadArray 报错问题

This commit is contained in:
liaoxuezhi 2019-10-22 21:54:41 +08:00
parent 498a848900
commit 514b98fc53

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])
})
);
}