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
538 stars 154 forks source link

Use readonly prop of v-form to disable the form #337

Open Meplos opened 2 years ago

Meplos commented 2 years ago

Hello, :vulcan_salute:

I wan't to check role of my user to enable or not modification on my schema. I setup readonly props of my v-form but not affect my vjsf child.

  <v-form
                ref="form"
                v-model="valid"
                autocomplete="off"
                :readonly="!$isGranted(role + 'UPDATE')"
            >

I also tried to put it in props of my vjsf but doesn't work. :disappointed:

So does solution exist to allow user to update data in all schema or not ?

Thanks , have a good day :sun_with_face:

PS : I know we could had readonly props in properties object but I wan't to avoid that.

albanm commented 2 years ago

See here. You can either set readOnly=true at the top of your schema or use disableAll option.

I didn't know about the readonly prop on v-form, I will try to respect it at some point.