From cfd733eba7ea92a62e80a433e9a66124a1df4f5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C2=B0=29=29=29=29=E5=BD=A1?= Date: Sun, 5 May 2019 14:16:41 +0800 Subject: [PATCH] feat(module: imagepicker): add capture&disableDelete API (#410) --- components/image-picker/doc/index.en-US.md | 4 +++- components/image-picker/doc/index.zh-CN.md | 2 ++ components/image-picker/image-picker.component.html | 2 ++ components/image-picker/image-picker.component.ts | 2 ++ 4 files changed, 9 insertions(+), 1 deletion(-) diff --git a/components/image-picker/doc/index.en-US.md b/components/image-picker/doc/index.en-US.md index 151c80fb..8b975409 100644 --- a/components/image-picker/doc/index.en-US.md +++ b/components/image-picker/doc/index.en-US.md @@ -18,4 +18,6 @@ Properties | Descrition | Type | Default | selectable | whether to show selector button | boolean | true | | multiple | whether support choose multi images at once | boolean | false | | accept | File type accept | string | image/* | -| length | Number of images in line | number | 4 | \ No newline at end of file +| length | Number of images in line | number | 4 | +| capture | Image capture setting, please refer to the description of capture in [MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/Input) | boolean \| string | false | +| disableDelete | whether to hide delete icon | boolean | false | \ No newline at end of file diff --git a/components/image-picker/doc/index.zh-CN.md b/components/image-picker/doc/index.zh-CN.md index 7819d7cc..b7623a33 100644 --- a/components/image-picker/doc/index.zh-CN.md +++ b/components/image-picker/doc/index.zh-CN.md @@ -20,3 +20,5 @@ subtitle: 图片选择器 | multiple | 是否支持多选 | boolean | false | | accept | 图片类型 | string | image/* | | length | 单行的图片数量 | number | 4 | +| capture | 图片捕获设置, 具体请参考[MDN](https://developer.mozilla.org/zh-CN/docs/Web/HTML/Element/Input)中关于capture的说明 | boolean \| string | false | +| disableDelete | 是否隐藏删除按钮 | boolean | false | diff --git a/components/image-picker/image-picker.component.html b/components/image-picker/image-picker.component.html index 9a3042ed..701c7f02 100644 --- a/components/image-picker/image-picker.component.html +++ b/components/image-picker/image-picker.component.html @@ -3,6 +3,7 @@
diff --git a/components/image-picker/image-picker.component.ts b/components/image-picker/image-picker.component.ts index 442a42d7..63d9f84c 100644 --- a/components/image-picker/image-picker.component.ts +++ b/components/image-picker/image-picker.component.ts @@ -23,6 +23,8 @@ export class ImagePicker { @ViewChild('fileSelectorInput', { read: ViewContainerRef }) private _fileSelectorInput: ViewContainerRef; + @Input() capture: boolean | string = false; + @Input() disableDelete: boolean = false; @Input() get files() { return this._files;