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/plugins/veeValidate.js

21 lines
536 B

import Vue from 'vue';
//validateion
import VeeValidate, { Validator } from "vee-validate";
import fa from "@Global/utils/vee-validate/locale/fa";
import "@Global/utils/vee-validate/newRules";
Vue.use(VeeValidate);
const phoneRule = {
getMessage(field, args) {
return `The ${field} must be either a valid phone number`;
},
validate(value, args) {
const PHONE_REG = /^0\d{2,3}\d{8}$/;
return PHONE_REG.test(value);
}
};
VeeValidate.Validator.extend('phone', phoneRule);
Validator.localize("fa", fa);