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

Suggestion: Add an example of emitting code for button #68

Open abhimanusharma opened 3 years ago

abhimanusharma commented 3 years ago

Hi,

I was looking at: http://vue-form-builder.sethphat.com/form-config

Instead of making post request with form action I want to post the formInput via emitting method.

I have done: emit-code-form-builder

Trying to emit that method like: form-render-emit-code

EDIT:

mounted() {
            this.$formEvent.$on("submit-form", value => {
                console.log("FormEventBus");
                console.log(value);
            })
        },

Tried above but did't work.

After click on submit button, it should call the "saveFormData" method.

I want to submit some custom field along with the form also had to send Auth-Token, so need the custom method to submit the data.

commno

My previous approach was to have a custom button on the render page, the submit the data with that but that will not check validations on form renderer. I have to run multiple loops to make that happen. So now I think its better to have button from the form builder and call the method using emit-code.

Please enlighten me O great one!