I am new to vee-validate and using V4 with vue.
I have a text field that take in a string which I then use @change to call a function to validate the string. If the string is invalid, I want to set an error message and return and then display the resulting error message.
If the string is valid, I then issue a REST api call and the result may or may not be successful and if not, I want to set an error message and return. There will likely only be a single error message
I use @change, as I only want to call the function when the field has completely changed and not on each character entered as seems to happen if I use rule:
I am struggling to see from the vee-validate v4 documentation as to how to set an error message such that it can be displayed:
I currently have this defined in my Form:
<div>
<Field name="PackageModel" type="text" as="vscode-text-field"
v-model = createPackageModel @change="asyncCall"
:title=constants.copyForwardText> Package Model
</Field>
<ErrorMessage name="PackageModel" class="error"></ErrorMessage>
</div>
My problem is how do I set an error message in the function ‘asyncCall and have it displayed. The V4 documentation is really hard work to wade through looking for this and it appears to have changed quite significantly since the previous version of vee-validate.