1.在mac上,在wepy框架下使用wx.chooseImage,在success中使用tempFilePaths,图片不显示,代码如下:
<img src="{{src}}" />
data = {
src: ''
}
uploadImg() {
let that = this;
wx.chooseImage({
count: 1, // 最多可以选择的图片张数
sizeType: ['original', 'compressed'],
sourceType: ['album', 'camera'],
success: function(res){
that.src = res.tempFilePaths;
console.log(that.src);
that.$apply();
}
})
}
有可能是微信开发者工具的问题,点击开发者工具右上角的预览,扫一扫在手机上测试,此时选择图片可以