safrazik / vue-file-agent

The most beautiful and full featured file upload component for Vue JS
https://safrazik.github.io/vue-file-agent/
MIT License
731 stars 93 forks source link

Reactive Filename #93

Open mattkirwan opened 4 years ago

mattkirwan commented 4 years ago

Hi,

I'm having trouble understanding how to get the filename to update from that sent back by the server after upload:

For example:

It requires that I hard refresh the page for the filename (and thumbnail etc..) to update - I would expect this to be reactive upon successful file upload.

The problem is all encapsulated in this screenshot below:

Screenshot from 2020-09-22 15-55-22

As you can see I've just uploaded "hockey-001" (black / no thumbnail). The server has responded with the unique server generated "name" but I can only see that once hard refreshed (F5) the page (other two videos).

Here is my implementation:

        <VueFileAgent
            ref="vfaDemoRef"
            @upload="onUpload($event)"
            @upload:update="onUpdate($event)"
            :uploadUrl="upload_url"
            :multiple="true"
            :editable="true"
            :deletable="true"
            v-model="fileRecords">

and the methods: onUpload and onUpdate aren't currently doing anything (empty).

All help / advice on where I'm going wrong is massively appreciated.

safrazik commented 4 years ago

Can you try the workaround mentioned here: #53

I'm working on v2 of this library which should be ready in few weeks. In v2, there's setName and setNameWithoutExtension methods for this purpose