pqina / vue-filepond

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

remove all files in vue3 script environment #255

Closed chance-up closed 2 years ago

chance-up commented 2 years ago

Is there an existing issue for this?

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

Describe the bug

to remove all files, want access the Filepond object and use 'removeFiles' method.

but i cant access filepond object (using ref)

Other examples say to use this.$ref.pond.removeFiles() , but cannot use this.$ref in the vue3 script method. How should I acess it?

`

` ### Reproduction always ### Environment ```markdown - Device: Mac - OS: 12.4 - Broser: Chrome 102. - Vue version: vue 3.2.36 + vite 2.9.9 - VueFilepond version : 7.0.3 ```
rikschennink commented 2 years ago

Hm that should work.

The FilePond instance is stored in this._pond, I don't have a workstation at hand but I'd try console.log(this.$refs.pond) and see what's in there. I suspect you can also call it like this this.$refs.pond._pond.removeFiles()

chance-up commented 2 years ago

When I access it with 'pond.value._pond.removeFiles()', it works normally. I'm sorry I didn't understand deeply and asked a question.

Thanks..