Summary: How can I achieve the same functionality in Vue 3 composition API as using this.$refs in Vue 2?
I am currently working on integrating PrimeVue's CustomUpload feature into a Vue 3 project. However, I have encountered an issue where the uploaded files are not cleared automatically after uploading. To resolve this, I need to call the clear() method of the child component from the parent component to clear the files and refresh the button.
Below is a snippet from my App.vue file:
<template>
<FileUpload
name="upload"
url="/"
mode="basic"
:auto="true"
:maxFileSize="26214400"
:fileLimit="1"
:customUpload="true"
@uploader="upload"
/>
<Button name="lalaal">qweeq</Button>
</template>
<script>
import FileUpload from 'primevue/fileupload'
export default {
setup() {
const upload = e => {
console.log('testing', e)
}
return { upload }
},
components: {
FileUpload
}
}
</script>
Thank you