uni-app 圖片接收圖片流

uni.request({
						url: url',
						method: 'GET',
						data: {},
						responseType: "arraybuffer",
						success: res => {
							let datas = res.data
							this.codeImg = 'data:image/png;base64,' + btoa(
								new Uint8Array(datas).reduce((datas, byte) => datas + String.fromCharCode(byte), '')
							);
						},
						fail: () => {},
						complete: () => {}
					});
<image :src="codeImg" mode=""></image>

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章