What happened?
I want to use a schema with an array as top-level structure.
Works in v4 but, in v5 the initial value (=array) is somehow converted to an object with index as keys.
actual value:
{
"0": {
"field1": "field1",
"field2": "field2"
}
}
expected value:
[
{
"field1": "field1",
"field2": "field2"
}
]
I figured out that I can use "." as name for the top-level array. If this is the proper way to do it please add this in the documentation. Didn't found it here.
<FieldArray name="." #default="{ fields }">
Reproduction steps
- use an initial value with an array as top-level structure
Version
Vue.js 3.x and vee-validate 5.x
What browsers are you seeing the problem on?
Relevant log output
Demo link
https://stackblitz.com/edit/vee-validate-issue-template-pzg7lfwl?file=src%2FApp.vue
Code of Conduct
What happened?
I want to use a schema with an array as top-level structure.
Works in v4 but, in v5 the initial value (=array) is somehow converted to an object with index as keys.
actual value:
expected value:
I figured out that I can use "." as name for the top-level array. If this is the proper way to do it please add this in the documentation. Didn't found it here.
Reproduction steps
Version
Vue.js 3.x and vee-validate 5.x
What browsers are you seeing the problem on?
Relevant log output
Demo link
https://stackblitz.com/edit/vee-validate-issue-template-pzg7lfwl?file=src%2FApp.vue
Code of Conduct