Skip to content

Commit d5fc13b

Browse files
committed
fix: upload ts error
1 parent 76ee4d6 commit d5fc13b

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

components/upload/Upload.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,27 @@ import { T, fileToObject, genPercentAdd, getFileItem, removeFileItem } from './u
1515
import { defineComponent, inject } from 'vue';
1616
import { getDataAndAriaProps } from '../_util/util';
1717

18+
export type UploadFileStatus = 'error' | 'success' | 'done' | 'uploading' | 'removed';
19+
export interface UploadFile<T = any> {
20+
uid: string;
21+
size?: number;
22+
name: string;
23+
fileName?: string;
24+
lastModified?: number;
25+
lastModifiedDate?: Date;
26+
url?: string;
27+
status?: UploadFileStatus;
28+
percent?: number;
29+
thumbUrl?: string;
30+
originFileObj?: any;
31+
response?: T;
32+
error?: any;
33+
linkProps?: any;
34+
type?: string;
35+
xhr?: T;
36+
preview?: string;
37+
}
38+
1839
export default defineComponent({
1940
name: 'AUpload',
2041
mixins: [BaseMixin],
@@ -185,7 +206,10 @@ export default defineComponent({
185206
if (result === false) {
186207
this.handleChange({
187208
file,
188-
fileList: uniqBy(stateFileList.concat(fileList.map(fileToObject)), item => item.uid),
209+
fileList: uniqBy(
210+
stateFileList.concat(fileList.map(fileToObject)),
211+
(item: UploadFile) => item.uid,
212+
),
189213
});
190214
return false;
191215
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy