3***@qq.com
3***@qq.com
  • 发布:2020-03-02 13:46
  • 更新:2020-03-02 15:31
  • 阅读:600

#插件讨论# 【 侧边导航分类模板,适用于商品分类导航等 - 七月_ 】大佬,请问这个图片url不存在的情况怎么处理?我在image的@error函数中设置了默认图片貌似没反应

分类:uni-app
我是这样写的:  
<image :src="item[imgSrc]" @error="bindImageError" :data-index="index2" />  

bindImageError(e) {  
    var index = e.currentTarget.dataset.index;  
    this.subCategoryList[index][this.label] = "../../static/img/100x100.jpg";  
}
2020-03-02 13:46 负责人:无 分享
已邀请:
七月_

七月_

<image :src="item[imgSrc]" v-if="!!item[imgSrc]"" />
<image src="../../static/img/100x100.jpg" v-else />

该问题目前已经被锁定, 无法添加新回复