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

Fixed error message and alert message on form render #70

Closed abhimanusharma closed 3 years ago

abhimanusharma commented 3 years ago

Error message color for vue-material should be red, default error message if options is given with VueFormbuilderPlugin.

sethsandaru commented 3 years ago

Hi,

I suppose this approach is only for "hotfix".It would be bad for maintenance.

My way of doing it at the moment:

// default install configuration
const defaultProperties =  {
    globalInjection : true,
    validationErrorShowAlert: true,
    validationErrorAlertText: "Your form got error(s), please fix it and submit again"
}

// extending
const userProperties = Object.assign(defaultProperties, properties || {}); // if properties falsy => new object

So the userProperties would have both configure data from the user and the default data from Vue Form Builder if they didn't override it.

Thanks for your contribution. I would like to close this PR.