接口api
export const getItemImage = data => {
return request({
url: '/exercise/getItemImage', //接口
method: 'get',
headers: {
'Content-Type': 'application/json'
},
params: data,
responseType: 'blob' //这个最重要,一定不要忘记
})
}
data(){
return{
img:' '
}
}
getItemImage() {
getItemImage(this.imgList).then(res => {
console.log(res);
this.img = window.URL.createObjectURL(res)
})
}
<img :src="img" alt="" />