问题已解决:
onScancode={this.handleScan} 监听扫描成功的方法
【taro官方文档没有更新】
J
jd_67b9cf1a538f7 发布的帖子
-
taro 中使用 Camera调用失败
感觉代码上没有什么问题,代码如下
<Camera device-position='back' mode='scanCode' bindscancode={this.handleScan} flash='off' style='width: 100%; height: 100%;' />
constructor(props) { super(props); this.state = { } this.getUser = this.getUser.bind(this) this.handleScan = this.handleScan.bind(this) } getUser() { console.log('user') } handleScan(e) { console.log(e) }
真机调试的问题:
求助一下这个怎么解决