Closed jiazehua closed 6 years ago
Messages can be either functions or strings, functions allow you to use the parameters sent to the rule ordered in an array as the second argument.
const betweenMessage = (name, params) => {
console.log(params[0]); // the min value
console.log(params[1]); // the max value
};
Array destructing allows you to re-write this in a better way:
const betweenMessage = (name, [min, max]) => {
console.log(min); // the min value
console.log(max); // the max value
};
For reference, you can check the English locale file which covers all rules, so you may find it useful as a documentation for any locale specific issues.
Versions
Describe the bug
For example, I made my own rules like that, but i don't know how to setup with the
between
, I can not get the range what i set like that way ↑