uni.chooseImage({
count: 1, //默认9
sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
sourceType: ['camera', 'album'], //从相册选择
success: function(res) {
console.log(JSON.stringify(res));
uni.getImageInfo({
src: res.tempFilePaths[0],
success: function(image) {
console.log(image)
console.log(image.width);
console.log(image.path);
}
});
const tempFilePaths = res.tempFilePaths;
this.problemImg = tempFilePaths[0];
console.log(this.problemImg)
}
});
<image class="mui-media-object" :src="problemImg"></image>
preview() {
// 预览图片
uni.previewImage({
urls: [this.problemImg]
});
},
chrome中是黑的,真机也一直在转圈