發送請求
request({ method: "GET", // 請求方式 url: "url地址", // 請求url responseType:'arraybuffer', // 一定要寫 data: data // 參數 })
發送請求拿到返回數據后轉換base64格式
.then(res => { let base64 = wx.arrayBufferToBase64(res) src = 'data:image/jpeg;base64,' + base64 })
image標簽(防止轉化后存在空格)
<image :src="src.replace(/[\r\n]/g,'')"></image>