Vue-dropzone: seems we can't have more than one instance of the component

Created on 10 Jan 2017  路  5Comments  路  Source: rowanwins/vue-dropzone

Uncaught Error: Dropzone already attached.
at new t (eval at

Is it possible to change this?
Many thanks

Most helpful comment

I've just tested and having it twice is fine, just make sure each instance has a unique id

So for example
<dropzone id="myVueDropzone" url="https://httpbin.org/post"></dropzone> <dropzone id="myVueDropzone2" url="https://httpbin.org/post"></dropzone>

Reopen the issue if you continue to run in to problems

All 5 comments

I've just tested and having it twice is fine, just make sure each instance has a unique id

So for example
<dropzone id="myVueDropzone" url="https://httpbin.org/post"></dropzone> <dropzone id="myVueDropzone2" url="https://httpbin.org/post"></dropzone>

Reopen the issue if you continue to run in to problems

thank you!

@rowanwins
Hi,

This is exactly what I need, but I add the component in a button click event.

I have a parent component that has an array of a child component. That child component uses the dropzone.
In my parent I start with 0 child components, and I append the child component in the button click event.
When I add the first instance of the child component the dropzone is also added, but when I add the second instance the id obviously stays the same. At that moment i get this error: [Vue warn]: Error in mounted hook: "Error: Dropzone already attached."
Do you have any idea how I can change the id of the dropzone at the moment I add the child component?
I've seached for an answer but I can't find anything specific for my problem.

Hi @thijs95

Can you post a snippet of your current setup.

Thanks

Here u go

Parent Template
Parent script

Child Template

Child Script

Thanks for the reply

Was this page helpful?
0 / 5 - 0 ratings