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