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.
willaengine/resources/js/Global/utils/vee-validate/newRules.js

19 lines
492 B

import { Validator } from "vee-validate";
const isBetween = (value, { min, max } = {}) => {
5 years ago
return Number(min) <= value.length && Number(max) >= value.length;
};
// The first param is called 'min', and the second is called 'max'.
5 years ago
const paramNames = ["min", "max"];
5 years ago
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);
}
});