You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working with a component approach. I need to set default values for fields without using :validation-schema=" for Form.But the values set in default do not appear in input. This works in the Composition Api approach, but it doesn't happen here. From devtools, I see that the scheme itself was worked out successfully, but the value itself did not appear in the input. For me, initial-values from Form is an area of global data, this data may or may not be present, I would like
default values to be present.
Also, for flexibility, I would like some fields to be removed from the output object, for this I used .strip(), which also had no effect, the field ended up in the object.
I am attaching both examples.
Reproduction steps
Use component style. Setup form.
Stup yup schema Use strip and default for some fields
Try to see default value
Submit form. To see a field that has not been deleted when using .strip()
...
I know that this can be done and I'm using it. Below I have given a link to an example. The code uses the composition api and sets the initial values using yup. I wanted to do it this way. If there are no initial values, then default values are substituted.
I'm working with a component approach. I need to set default values for fields without using
:validation-schema="
forForm
.But the values set indefault
do not appear in input. This works in the Composition Api approach, but it doesn't happen here. From devtools, I see that the scheme itself was worked out successfully, but the value itself did not appear in theinput
. For me, initial-values fromForm
is an area of global data, this data may or may not be present, I would likedefault values to be present.
Also, for flexibility, I would like some fields to be removed from the output object, for this I used
.strip()
, which also had no effect, the field ended up in the object.I am attaching both examples.
Reproduction steps
strip
anddefault
for some fields.strip()
...
Version
Vue.js 3.x and vee-validate 4.x
What browsers are you seeing the problem on?
Relevant log output
No response
Demo link
https://stackblitz.com/edit/nuxt-starter-xjvmlu?file=pages%2Findex.vue
Code of Conduct
The text was updated successfully, but these errors were encountered: