ITADN

a top-level array as initialValue is corrupted

#5148Openfembau 创建于 2026-03-19
F
fembaucommented
### 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](https://vee-validate.logaretm.com/v5/examples/array-fields/). ``` <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? - [ ] Firefox - [ ] Chrome - [ ] Safari - [ ] Microsoft Edge ### Relevant log output ```shell ``` ### Demo link https://stackblitz.com/edit/vee-validate-issue-template-pzg7lfwl?file=src%2FApp.vue ### Code of Conduct - [x] I agree to follow this project's [Code of Conduct](CONDUCT.md)
0 条评论