-
Hey, I am kind of having a similar problem as in #1821 at the moment with vee-validate v4.7.3. I tried calling the My code looks something like this: <script setup lang="ts">
const data = ref<SomeObjectType[]>([])
// ...
const formField = reactive(useField(props.name, undefined, { initialValue: props.initialValue }));
watch(data, (newData) => {
formField.setValue(newData);
}, { deep: true }
);
onMounted(() => {
data.value.map(async (data) => {
// this data mutation leads to the form field being flagged as dirty
file.moreData = await generateSomeMoreData()
});
// here would be the place to reset the validation or override the dirty flag
});
</script> Is there any other method I'm currently missing that could do this or is it simply not possible at the moment the way I'd like to do it? I already read that it would be possible to reset the validation at the form level, but that would unfortunately be a 'not so nice' workaround in my use case since form and field are different components. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Actually |
Beta Was this translation helpful? Give feedback.
Actually
resetField
should work here and we have a test for it. Unless the equality check is failing somehow fordirty
calculation. Do you mind creating a sample? I can then take a look.