koumoul-dev / vuetify-jsonschema-form

Create beautiful and low-effort forms that output valid data. Published on npm as @koumoul/vjsf.
https://koumoul-dev.github.io/vuetify-jsonschema-form/latest/
MIT License
553 stars 156 forks source link

Date Field is not displaying values when model computed #150

Closed jithin-space closed 4 years ago

jithin-space commented 4 years ago

When the model is a computed property, the date fields are not displaying the selected values. How can I fix that??

albanm commented 4 years ago

Having a computed property as the model is weird no ? I guess it can make sense to display a fully read-only form. Still v-jsf expects a model that it can mutate, so a data property not a computed property.

jithin-space commented 4 years ago

I am trying to generate an editable form filled with values from the database. data is stored in vuex, and had to do some preprocessing to convert the data into a form that vjsf can render properly.

Are you saying that such use cases cannot be handled effectively??

albanm commented 4 years ago

No it can be done of course. But you must process the model then put it in a data property, not use a computed property. This is not a problem with this library, but with how to use vuejs. The computed properties are not meant to be mutated directly.