Skip to content

Commit

Permalink
types: fix upload and wheel types
Browse files Browse the repository at this point in the history
  • Loading branch information
qmhc committed Jun 1, 2022
1 parent eb8421e commit 7cd7f0d
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
8 changes: 4 additions & 4 deletions components/upload/symbol.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// export type UploadStatusType = 'pending' | 'uploading' | 'fail' | 'success' | 'delete'
export type UploadListType = 'name' | 'detail' | 'thumbnail' | 'card'

export type BeforeFn = (file: File, files: File[]) => any | Promise<any>
export type RenderFn = (data: { file: File }) => any
export type SourceFile = File & { path?: string }

export type BeforeFn = (file: SourceFile, files: SourceFile[]) => any | Promise<any>
export type RenderFn = (data: { file: SourceFile }) => any

export type HttpError = Error & {
response: any,
Expand All @@ -19,8 +21,6 @@ export enum UploadStatusType {
DELETE = 'delete'
}

export type SourceFile = File & { path?: string }

export interface FileState {
id: string,
name: string,
Expand Down
2 changes: 1 addition & 1 deletion components/upload/upload.vue
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ export default defineComponent({
}
}
function getSourceFiles() {
function getSourceFiles(): SourceFile[] {
return fileStates.value.map(file => file.source)
}
Expand Down
4 changes: 2 additions & 2 deletions components/wheel/wheel-item.vue
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ export default defineComponent({
const style = computed(() => {
return {
width: width.value ? `${width.value}px` : null,
height: height.value ? `${height.value}px` : null
width: width.value ? `${width.value}px` : undefined,
height: height.value ? `${height.value}px` : undefined
}
})
Expand Down

0 comments on commit 7cd7f0d

Please sign in to comment.