fix: return refs from useFileUpload

This commit is contained in:
Hassan Ben Jobrane
2023-10-23 19:46:51 +01:00
parent 8ca9f76cb2
commit 00a06466f5
2 changed files with 6 additions and 6 deletions

View File

@@ -34,9 +34,9 @@ import FileUpload from '../components/FileUpload.vue'
const { upload, isUploaded, isUploading, isError } = useFileUpload()
console.log({
isUploaded,
isUploading,
isError
isUploaded: isUploaded.value,
isUploading: isUploading.value,
isError: isError.value
})
// const {

View File

@@ -42,7 +42,7 @@ export type { FileItemRef }
* It has the same signature as `useFileUpload`.
*
* @example
* ```tsx
* ```ts
* const Item = ({itemRef}) => {
* const { name, progress} = useFileUploadItem(itemRef)
* return <li>{name} {progress}</li>
@@ -66,7 +66,7 @@ export const useFileUploadItem = (
ref.send({
type: 'ADD',
file: params.file,
bucketId: params.bucketId || bucketId
bucketId: params.bucketId || bucketId.value
})
}
@@ -95,7 +95,7 @@ export const useFileUploadItem = (
const error = useSelector(ref, (state) => state.context.error || null)
const progress = useSelector(ref, (state) => state.context.progress)
const id = useSelector(ref, (state) => state.context.id)
const bucketId = useSelector(ref, (state) => state.context.bucketId).value
const bucketId = useSelector(ref, (state) => state.context.bucketId)
const name = useSelector(ref, (state) => state.context.file?.name)
return {