electron-vue 图片加载失败后使用默认头像

<img :src="item.headUrl" alt="" class="contact-head" :onerror="morenImage">

data () {
  return {
    morenImage: 'this.src="static/image/head.png"', // 默认头像
   }
 }

猜你喜欢

转载自www.cnblogs.com/ybixian/p/10704134.html