Closed felixpy closed 8 years ago
Thank you for your reporting! I tried to reproduce this issue, but I could not. Can you provide the minimum reproduction example code with jsfiddle(or jsbin, codepen...etc) please?
Sorry for the late response. Here is the example: jsfiddle I think "errors" array should list all errors even without specified message. BTW, is there a way to add default message for those rules already in vue-validator(required, maxlength, etc.)?
Sorry for late response. I checked the your jsfiddle code. This is the expectable behavior of vue-validator.
.>BTW, is there a way to add default message for those rules already in vue-validator(required, maxlength, etc.)?
You can the set the below.
Vue.validator('required', {
message: function (field) { // string or function
return 'required "' + field + '"'
},
check: Vue.validator('required')
})
Thx, I'll try it.
Here is the html:
Only when I changed the v-validate derective to
v-validate:short-title="{maxlength:{rule:12,message:'Too long'}}"
can I get the "errors" array. So how can I fix this? Thanks.