- 下载插件并导入
npm install --save @ionic-native/camera
ionic cordova plugin add cordova-plugin-camera
module.ts中
import {
Camera,CameraOptions} from '@ionic-native/camera/ngx';
- ts使用
async changeavatar() {
const actionSheet = await this.actionSheetController.create({
header: '上传图片',
cssClass:'camera',
buttons: [{
text: '相机拍照',
icon