Closed afwn90cj93201nixr2e1re closed 5 years ago
Also if u can, add some examples for printing all error's for every field, like dat: https://buefy.org/extensions/veevalidate
Need something like simple input validation.
So I am not expected to know Russian, so please write issues in English.
As for the multi error extractor, use the baseMultiErrorExtractor component for simple error looping, its just a data provider with a scoped slot.
The mixin is used to do more advanced stuff, as you have full control and access to the component's properties and methods.
Everything is explained in the docs, with examples.
Could u explain what MultierrorExtractor and SingleErrorExtractor are doing? What the differences, with examples(if u can).
Multierror displays all errors and singleerror display one error per input? Or what?
How we can just get error object with strings, without formwrappers and etc? There are we have a field:
<b-field :type="{ 'is-danger': $v.szLogin.$invalid }"
:message="[ {'Username is bad': $v.szLogin.$invalid},{'Username required':!$v.szLogin.required}]"> <!-- etc -->
<b-input placeholder="Логин" v-model.trim="$v.szLogin.$model" autocomplete="off" novalidate></b-input>
</b-field>
How we can output error's like dat?
<b-field :type="{ 'is-danger': $v.szLogin.$invalid }"
:message="$v.szLogin.errorsTextFromVuelidateErrorExtractor"> <!-- etc -->
<b-input placeholder="Логин" v-model.trim="$v.szLogin.$model" autocomplete="off" novalidate></b-input>
</b-field>
with formating like each error - <br>
at the end or \n.
@dobromir-hristov
<b-field :type="{ 'is-danger': $v.szLogin.$invalid, 'is-success': $v.szLogin.$invalid }"
:message="loginmessage"> <!-- etc -->
Something like this.
loginmessage() {
//let some_array = [];
//for(error in this.$v.szLogin.errorsaddedbyvueerrorextractor){
//some_array[error].text = error.text;
//some_array[error].param = error.param;
//}
//some_array[
//{'{inputname} must be shorter than {min}':this.$v.szLogin.minLength},
//{'{inputname} must be shorter than {max}':this.$v.szLogin.maxLength},
//{'{inputname} must be filled':this.$v.szLogin.required},
//]
return `Username is bad, must be ${this.$v.szLogin.$params.minLength.min}`;
},
You are approaching things in a way, that this plugin is not intended to work with.
The multiErrorExtractor shows all errors for all fields in a form, the singleErrorExtractor all errors for a single field.
Extracting error messages happens ONLY with a wrapper component, via a mixin. You can use a wrapper component with a scoped slot to extract error fields if you want. There is no helper, like what you need.
There is a whole page on usage with other UI libraries, check it for more examples. https://dobromir-hristov.github.io/vuelidate-error-extractor/other_frameworks.html
The docs explain this well enough.
The multiErrorExtractor shows all errors for all fields in a form, the singleErrorExtractor all errors for a single field.
Thank's, that's all what i need to know. Ok, then can u explain when we must use BaseMulti, bp3, bp4, fn6 and etc?
Можно больше информации о том, что именно каждая из опций выполняет?
Чем
Отличается от
или
Ну и т.д
В документации очень кратко все.