Open BenJackGill opened 2 months ago
Might be doable if you explicitly provide a model name/prop so it knows which events to emit. Since defineField
is meant to be used multiple times within a component so it cannot default to modelValue
like useField
.
I don't see this on the roadmap anytime soon, but I will mark it as an enhancement.
Is your feature request related to a problem? Please describe.
The
useFeild
composable has a convenientsyncVModel
option which is missing fromdefineField
.Many times I do not want to create a seperate component and instead just use
defineField
which is exported fromuseForm
. The problem is thatdefineField
doesn't have thesyncVModel
option so I cannot sync my own refs, such as the newdefinemodel
which is very useful.This issue was also brought up on StackOverflow, with more detailed code example: https://stackoverflow.com/questions/78657896/how-to-use-definemodel-with-vee-validate
Describe the solution you'd like
Add
syncVModel
option todefineField
.Describe alternatives you've considered
We can use a watchEffect instead, but that quickly becomes verbose because we need one per field.