Package Exports
- universal-choose-image
 
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (universal-choose-image) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
universal-choose-image 
选取图片
支持
 
 
 
  
安装
$ npm install universal-choose-image --save使用
import chooseImage from 'universal-choose-image';
// 快应用中的引入方法
// import chooseImage from 'universal-choose-image/lib/quickapp;
chooseImage().then(res => {
})方法
chooseImage(options)
选取照片数据
参数
| 成员 | 类型 | 描述 | 必选 | 默认值 | 支持 | 
|---|---|---|---|---|---|
| options | object | 
选取照片参数 | 否 | - | |
| options.count | number | 
最大可选照片数 | 否 | 1 | 
|
| options.sourceType | array | 
相册选取或者拍照 | 否 | camera, album | 
|
| options.accept | string | 
允许的文件类型 | 否 | image/* | 
返回值
| 成员 | 类型 | 描述 | 
|---|---|---|
| res | object | 
|
| res.data | string[] | 
Web 环境为 base64 数据,小程序中为图片路径 | 
| res.files | File[] | 
仅 Web 环境存在,为原始的文件对象 |