pqina / vue-filepond

🔌 A handy FilePond adapter component for Vue
https://pqina.nl/filepond
MIT License
1.91k stars 128 forks source link

[Bug Ajax post requests] #243

Closed sgb999 closed 2 years ago

sgb999 commented 2 years ago

Is there an existing issue for this?

Have you updated Vue FilePond, FilePond, and all plugins?

Describe the bug

Due to the way filepond works in vue.js, you are not able to submit the form with a javascript post request as you normally would do in vue.js by using the v-model directive, instead you have to do a hacky way around it by using the @processfile @removefile method calls

Reproduction

<file-pond id="avatar" name="avatar" v-model="form.avatar" ref="pond" label-idle="Drop image here..." v-bind:allow-multiple="false" accepted-file-types="image/jpeg, image/png" :server="{ url: '/tmp/image', headers: { 'X-CSRF-TOKEN': $page.props.csrf } }"

                />

data() { let form = useForm({ name : '', username : '', email : '', password : '', password_confirmation : '', avatar : '', _token : this.$page.props.csrf, }); return { form } },

Environment

- Device: Desktop Computer
- OS:Windows 11
- Browser: Google Chrome
- Vue version: 3.2.31
rikschennink commented 2 years ago

Closed because no code formatting, no proposed solution.