Open fbnlsr opened 1 year ago
Has there been any updates on this? Facing the same issue.
Any updates on this? I am running into the same issue.
Upload example uses objectURL and it works but the compiler doesn't know about it
Can confirm this also. Am using the URL.createObjectURL(file)
workaround like so:
Inside <script>
:
const fileObjectURL = (file: File) => {
return URL.createObjectURL(file);
};
Inside <template>
:
<img
:alt="file.name"
:src="fileObjectURL(file)"
height="50"
role="presentation"
width="100"
/>
Describe the bug
I'm following the example in the documentation regarding custom uploaders on the
FileUpload
component, and I get a type error onobjectURL
.As far as I know,
objectURL
is not a property ofFile
, yet the object returned contains said property. The code works fine but Typescript is not happy about what's going on, and I can't figure out what's wrong.Reproducer
-
PrimeVue version
3.37.0
Vue version
3.x
Language
TypeScript
Build / Runtime
Vite
Browser(s)
No response
Steps to reproduce the behavior
No response
Expected behavior
Typescript should not yell at me.