You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
|
|
|
import { Validator } from "vee-validate";
|
|
|
|
|
|
|
|
const isBetween = (value, { min, max } = {}) => {
|
|
|
|
return Number(min) <= value.length && Number(max) >= value.length;
|
|
|
|
};
|
|
|
|
|
|
|
|
// The first param is called 'min', and the second is called 'max'.
|
|
|
|
const paramNames = ["min", "max"];
|
|
|
|
|
|
|
|
Validator.extend("digits_between", isBetween, {
|
|
|
|
paramNames // pass it in the extend options.
|
|
|
|
});
|
|
|
|
|
|
|
|
Validator.extend("alpha_en_dash", {
|
|
|
|
validate(value) {
|
|
|
|
return /^[0-9A-Za-z\-\_]+$/.test(value);
|
|
|
|
}
|
|
|
|
});
|