vue-filepond: Binding to "files" variable doesn't updates after file upload"
I’ve created a component with this bindings:
<file-pond name="test"
ref="pond"
label-idle="Перетащите сюда файлы..."
max-files="4"
allow-multiple="true"
accepted-file-types="csv, shx, shp, dbf"
server="/Loader/Upload"
v-bind:files="myFiles"
v-on:init="handleFilePondInit" />
<div v-for="(item, index) in myFiles">
<input asp-for="filenames[i]" v-bind="item" type="hidden" />
</div>
But v-for doesn’t work because “myfiles” doesn’t update
About this issue
- Original URL
- State: open
- Created 6 years ago
- Reactions: 12
- Comments: 18
Hi @rikschennink I made this workaround for the problem:
I haven’t got enough work time on weekdays for adding this functionallity to vue-filepond but I think I can make it on the weekend 😃
@jaymefrantz You probably already figured it out, but you need to use something like this:
See the list of available callbacks, but you have to remove the
onprefix.I’m not sure if the
removefilecallback is meant to be used in the example by @novikov-alexander-zz orprocessfilerevert, since the function signature forremovefileneeds to have an error as first argument, not a file:That will be an awesome functionality, in my case I don’t want to make automatic updates to the server and having a lot of refs can be a hassle. This will simplify getting the files 💯
Hi. Sorry to “reanimate” this issue, but has any of you managed to implement this in the current build?
Hi @novikov-alexander the
filesbinding is currently only for programmatically adding initial files, or updating the current file set, it doesn’t (currently) reflect the state of loaded (dropped) files.I’ll see if I can add this in a future release ( pull requests are also welcome ) as it would be a very useful feature to have.