Not getting errors back from rule validation #4324
Replies: 2 comments 3 replies
-
How do you define your rules? Or rather what does the validation function look like, I don't see any of vee-validate API in your example. |
Beta Was this translation helpful? Give feedback.
-
@logaretm My code looks like this:
The doc seems to recommend using useField instead of andIf I wanted to not have to use and is that possible when my ref field is an array of objects accessed with an index as shown below?
The example in the doc is very simple in that it assumes a simple variable - value in this example below:
I cannot see any means of defining that const line with my very long indexed arrray object where the index etc is not available to the <script> section as it is part of a v-if in the <template.... This was the reason I was going down the <Field route. |
Beta Was this translation helpful? Give feedback.
-
I am just picking up vee Validate and trying to perform a simple validation of the entered input field.
This is being used in a VSCode Extension that is in turn making use of a webview and using VSCode provided custom components.
My problem is that I am working with an array of embedded objects and I am creating the panel dynamically based on the array contents.
This is all working fine but I now want to add some simple validation to the fields.
I am using
script setup lang="ts"
My template section looks like this below: My problem is that the v-model is using the array structure and I am unable to find a way of making that available to the rule in the <script> section.
for example:
v-model="baseArgs[profIndex].mergedArgs.missingArgs[index].value"
If it had been a single simple variable it would have been easy.
If I can get the v-model field made known to the rule, then I could simplify the v-if v-else-if as it is only exists in this current form to allow me to specify required or maxlength options etc
In my script I have this defined:
const baseArgs:any= reactive([{}]);
which I fill with this that I am passed from the VSCode Extension:
Object.assign(baseArgs,message.input.webviewbaseProfileArray);
Any suggestions on how I might possibly tackle this?
Beta Was this translation helpful? Give feedback.
All reactions