0👍
maybe you can just use :rules="{required: true, digits:4}"
instead?
import {digits} from 'vee-validate/dist/rules';
extend('digits', {
...digits,
message: `only four digits ...!!!!`,
})
or
extend("equalFourDigits", {
validate: (value) => {
const regex = new RegExp(/^\d{4}$/)
if (regex.test(value)) {
return true;
}
return `Your code must be 4 digits. ${value}`;
},
});
- [Vuejs]-How con i change data value from a function?
- [Vuejs]-Vuejs invoice transactions, input item push
Source:stackexchange.com