Installation
This package contains validators to use in combination of your form library.
bash
npm i @xerius/codey-validations
Usage in Vuelidate
Import the module into your project by using the named import.
js
import { isBelgianIban } from "@xerius/codey-validators";
export default {
components: {
XerAccountNumber,
},
data() {
return {
accountNumber: "",
};
},
validations: {
accountNumber: {
required,
isBelgianIban,
},
},
methods: {
setAccountNumber(value) {
this.accountNumber = value;
this.$v.accountNumber.$touch();
},
},
};
All validators
Name | Parameter | Description |
---|---|---|
isBelgianIban | Checks wether the given string is a valid Belgian iban | |
isIban | Checks wether the given string is a valid iban (you will need to provide the country code in the string yourself) | |
isValidDate | format (Example: dd-mm-yyyy) | Checks wether the given string is a valid date |
isValidSocialSecurityNumber | Checks wether the given string is a valid social security number |