I want to update the url option for the dropzone component dynamically later.
Following is the Vue component I have:
<div id="app">
<vue-dropzone ref="myVueDropzone" id="dropzone" :options="dropzoneOptions"></vue-dropzone>
<button @click="updateUrl()">
Update
</button>
</div>
<script>
new Vue({
el: "#app",
data: {
dropzoneOptions: {
url : "https://google.com"
}
},
computed:{
},
components: {
vueDropzone: vue2Dropzone
},
methods: {
updateUrl(){
console.log("Updating url")
this.dropzoneOptions.url = "http://example.com"
}
}
})
</script>
When I try to update using the button click, I see that the dropzoneOptions.url has been updated. But, when I try uploading files, the files are still posted to the old url https://google.com
Link to JSFiddle: https://jsfiddle.net/1t7L6ouc/3/
There is an
options
property that lets you define theurl
. Since you have given it aref
, you should be able to update it like: