fix: return refs from useFileUpload
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user