Hi,
I am updating my app to the new Vue CLI 3 and noticed that all my fields using a multi-level model stopped working (the field's value remains undefined).
model: {
id: 1234,
person: {
name: "John Doe"
age: 22
},
}
For example, a field using id will work fine, but person.name or person.age won't.
I tested vue-form-generator on a brand new project created with Vue CLI 3 (default settings) and the problem persists.
Any ideas?
Thanks!
Actually, the Vue CLI version has nothing to do. It seems to be a bug in vue-form-generator version 2.3.1.
I rolled back to version 2.3.0 and it works fine.
It also my problem . I use get(model) set(model, value) to fix it, but still have some bug here, and code will be dirty. So hope it will update for this problem.
can you use groups for multi-level schema? I can only two layers
I'm having the same problem here and I'm not using Vue CLI 3. Running Vue v2.5.17
@AruXc can you give an example of how you do it with get(model) and set(model, value) ?
Will be fixed soon, same problem as #526
Will do a PR tomorrow !
@lionel-bijaoui I just realized it! Thanks for the quick response. I rolled back to 2.3.0 in the meantime.
@LouWii simple example but I think this is not a good way to write.
```
model: {
smoking: {
smoking: true
}
},
schema: {
fields: [
{
type: "radios",
model: "",
values: [
{ name: "No", value: false },
{ name: "Yes", value: true }
],
get(model) {
return model.smoking.smoking
},
set(model, value) {
model.smoking.smoking = value
}
}
]
}
@AruXc That's an interesting way of doing it. I installed v2.3.0 and I don't have issues anymore, no need for a work around. You can probably try that if you like.
Should be fixed by #532
Most helpful comment
Will be fixed soon, same problem as #526
Will do a PR tomorrow !