Skip to content
This repository has been archived by the owner on Dec 6, 2021. It is now read-only.

Commit

Permalink
fix(image-picker): fix sizeType and sourceType typo and add default v…
Browse files Browse the repository at this point in the history
…alues for both props
  • Loading branch information
b2nil committed Jan 17, 2021
1 parent dd7c309 commit 3b733bb
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
10 changes: 8 additions & 2 deletions src/components/image-picker/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,14 @@ const AtImagePicker = defineComponent({
default: 4
},
count: Number as PropType<AtImagePickerProps['count']>,
sizetype: Array as PropType<AtImagePickerProps['sizeType']>,
sourcetype: Array as PropType<AtImagePickerProps['sourceType']>,
sizeType: {
type: Array as PropType<AtImagePickerProps['sizeType']>,
default: () => ['original', 'compressed']
},
sourceType: {
type: Array as PropType<AtImagePickerProps['sourceType']>,
default: () => ['album', 'camera']
},
// 事件
onChange: {
type: Function as PropType<AtImagePickerProps['onChange']>,
Expand Down
12 changes: 10 additions & 2 deletions types/image-picker.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,22 @@ export interface AtImagePickerProps extends AtComponent {
count?: number
/**
* 所选的图片的尺寸
* - `original`: 原图
* - `compressed`: 压缩图
* @default ["original", "compressed"]
* @since v2.0.2
*/
sizeType?: string[]
sizeType?: ("original" | "compressed")[]
/**
* 选择图片的来源
* - `album`: 从相册选图
* - `camera`: 使用相机
* - `user`: 使用前置摄像头 (仅H5纯浏览器使用)
* - `environment`: 使用后置摄像头 (仅H5纯浏览器)
* @default ["album", "camera"]
* @since v2.0.2
*/
sourceType?: string[]
sourceType?: ("album" | "camera" | "user" | "environment")[]
/**
* files 值发生变化触发的回调函数, operationType 操作类型有添加,移除,如果是移除操作,则第三个参数代表的是移除图片的索引
*/
Expand Down

0 comments on commit 3b733bb

Please sign in to comment.