ionic4 - 从相机或图库上传图像
问题描述
我正在使用 Ionic 4。当我从相机或画廊上传图像时,我收到了 Type Script 错误。
我尝试了以下代码:
chooseImage() {
let actionSheet = this.actionSheet.create({
title: 'Choose Picture Source',
buttons: [{
text: 'Gallery',
icon: 'albums',
handler: () => {
this.actionHandler(1);
}
},
{
text: 'Camera',
icon: 'camera',
handler: () => {
this.actionHandler(2);
}
},
{
text: 'Cancel',
role: 'cancel',
handler: () => {
console.log('Cancel clicked');
}
}
]
});
actionSheet.present();
}
解决方案
推荐阅读
- python - 通过格式字符串用 pandas 读取 dat 文件
- node.js - Selenium-WebDriver UnhandeledPromiseRejectionWarning 错误
- python - 将日期序列分配给 pandas groupby 组
- reactjs - 无法在反应中加载背景图像
- ios - 等待线程Objective C中的值更改
- java - 切点中的 AspectJ 形式化未绑定
- reactjs - 元素类型无效:应为字符串(用于内置组件)或类/函数(用于复合组件)但得到:符号
- vue.js - TinyMCE 中带有指令的扩展有效元素
- python - Django makemessages “struct.error: unpack 需要 4 个字节的缓冲区”
- ghostscript - 无法在 Windows 10 中编辑 ghostprint ppd