You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Browser: Chrome Version 111.0.5563.147 (Official Build) (64-bit)
Operating System: Widows 10
Description:
I am trying to use the validator with the "individual usage" configuration but I get console warnings saying the field doesn't have a validation rule. ==> The field 'length' is missing a validation rule: 'required'
Even though required is a default rule.
I even tried a custom rule and didn't have more luck.
Hi @loicdekester , you need to modify your code like this:
validatorRules.js
exportdefault{required: {validate(value){return!value;},message: '%s is empty',},// ...};
HelloWorld.vue
import{useValidator}from'balm-ui/plugins/validator';// Because of individual usage// ...functionvalidate(){const{ valid, validMsg }=validator.validate(formData);// ...}
I see the problem, both in main.js and in components when we use the validator we have to get it from 'balm-ui/plugins/validator' for individual usage.
Development Relevant Information:
Description:
I am trying to use the validator with the "individual usage" configuration but I get console warnings saying the field doesn't have a validation rule. ==> The field 'length' is missing a validation rule: 'required'
Even though required is a default rule.
I even tried a custom rule and didn't have more luck.
Steps To Reproduce:
Here is a link to see the error: https://stackblitz.com/edit/vue-exxmy9?file=src/main.js
The form has a input event that triggers the validation.
The text was updated successfully, but these errors were encountered: