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
414 stars 129 forks source link

Impossible to turn off validation error alert #113

Open dvuckovic opened 2 years ago

dvuckovic commented 2 years ago

Although the documentation does make a reference of the validationErrorShowAlert option, any "falsy" values suplied for it will be ignored by the plugin. Effectively, this means the error alert can not be turned off.

To reproduce, try the following while installing the plugin:

import { VueFormBuilderPlugin } from 'v-form-builder';

Vue.use(VueFormBuilderPlugin, {
  // This will be ignored due to a bug in VueFormBuilder plugin.
  validationErrorShowAlert: false,
});

A quick-n-dirty workaround would be to explicitly set this option before using form renderer component inside a Vue component. This can be done via exposed $form property on the Vue instance. For example:

@Component
export default class FormRenderer extends Vue {
  created() {
    // Disable built-in validation error alert in VueFormBuilder.
    this.$form.validationErrorShowAlert = false;
  }
}