fix: upload ts error
parent
76ee4d6856
commit
d5fc13b16f
|
@ -15,6 +15,27 @@ import { T, fileToObject, genPercentAdd, getFileItem, removeFileItem } from './u
|
||||||
import { defineComponent, inject } from 'vue';
|
import { defineComponent, inject } from 'vue';
|
||||||
import { getDataAndAriaProps } from '../_util/util';
|
import { getDataAndAriaProps } from '../_util/util';
|
||||||
|
|
||||||
|
export type UploadFileStatus = 'error' | 'success' | 'done' | 'uploading' | 'removed';
|
||||||
|
export interface UploadFile<T = any> {
|
||||||
|
uid: string;
|
||||||
|
size?: number;
|
||||||
|
name: string;
|
||||||
|
fileName?: string;
|
||||||
|
lastModified?: number;
|
||||||
|
lastModifiedDate?: Date;
|
||||||
|
url?: string;
|
||||||
|
status?: UploadFileStatus;
|
||||||
|
percent?: number;
|
||||||
|
thumbUrl?: string;
|
||||||
|
originFileObj?: any;
|
||||||
|
response?: T;
|
||||||
|
error?: any;
|
||||||
|
linkProps?: any;
|
||||||
|
type?: string;
|
||||||
|
xhr?: T;
|
||||||
|
preview?: string;
|
||||||
|
}
|
||||||
|
|
||||||
export default defineComponent({
|
export default defineComponent({
|
||||||
name: 'AUpload',
|
name: 'AUpload',
|
||||||
mixins: [BaseMixin],
|
mixins: [BaseMixin],
|
||||||
|
@ -185,7 +206,10 @@ export default defineComponent({
|
||||||
if (result === false) {
|
if (result === false) {
|
||||||
this.handleChange({
|
this.handleChange({
|
||||||
file,
|
file,
|
||||||
fileList: uniqBy(stateFileList.concat(fileList.map(fileToObject)), item => item.uid),
|
fileList: uniqBy(
|
||||||
|
stateFileList.concat(fileList.map(fileToObject)),
|
||||||
|
(item: UploadFile) => item.uid,
|
||||||
|
),
|
||||||
});
|
});
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue