Currently, I am delving into Quasar using TypeScript and encountering a type error while working on file uploads.
Here is the snippet of my code where the type error arises specifically in the parameter of the form.append() method.
The error message reads as follows: "Argument of type 'Ref
I am unsure about how to properly set the type for the file variable.
<script setup lang="ts">
import { ref, Ref } from 'vue';
import { QFile } from 'quasar';
const file: Ref<File | null> = ref(null);
const pickFile = (): void => {
console.log(file.value);
const formData = new FormData();
formData.append('file', file);
console.log(file.value);
};
</script>
<template>
<q-file v-model="file" label="File Upload" @update:model-value="pickFile()">
<template #prepend>
<q-icon name="mdi-attachment"></q-icon>
</template>
</q-file>
</template>