template
<img :onerror="errorUserPhoto" :src="'Ecp.Picture.view.img?pictureId=' + head_pic" />
script
import userPhoto from '@/assets/images/userPhoto.jpg'
data() {
return {
errorUserPhoto:'this.src="' + userPhoto + '"',
}
}
<img :onerror="errorUserPhoto" :src="'Ecp.Picture.view.img?pictureId=' + head_pic" />
import userPhoto from '@/assets/images/userPhoto.jpg'
data() {
return {
errorUserPhoto:'this.src="' + userPhoto + '"',
}
}
https://blog.csdn.net/weixin_36934930/article/details/80576630