sethsandaru / vue-form-builder

Super Form Builder built on top of Vue with Drag & Drop functionality, savable-form-schema and easy to maintain/upgrade your form.
http://vue-form-builder.sethphat.com
MIT License
413 stars 129 forks source link

Read only form renderer #67

Closed abhimanusharma closed 3 years ago

abhimanusharma commented 3 years ago

Hi,

We can save form builder configuration and render the form using saved configuration data. We can use v-model="formInput" to render the saved form data, but is it possible to make it read only. So that user can not update the value of form-Input.

<FormRenderer
            :form-configuration="formData"
            v-model="formInputData"
            readonly
    />

OR

<FormRenderer
            :form-configuration="formData"
            v-model="formInputData"
            :read-only="true"
    />
sethsandaru commented 3 years ago

Hi @abhimanusharma ,

Looks great. But I think I would like to do the "readonly/disable" like below:

methods: {
    disableField() {
        this.$formBuilder.disableField('field_unique_name');
    },
   enableField() {
        this.$formBuilder.enableField('field_unique_name');
   },
   enableAllFields() {
        this.$formBuilder.enableAllFields();
   },
   disableAllFields() {
        this.$formBuilder.disableAllFields();
   },
}

It would be more flexible for the Form Renderer too. Would add this one for @2.1.0.

Thanks

abhimanusharma commented 3 years ago

Awesome. Let's do this 🤩