场景: ios 微信
后台获取的图片为http开头的超链接
首次在ios(微信)中打开图片渲染是空白的 数据有获取到
再次刷新后图片才会显示正常
经过测试在android没有出现上述问题
html
<div class="bugImg" v-if="bugDetail">
<img
v-for="(imgItem,index) in bugDetail.disposefileList"
:key="imgItem.index"
:src="imgItem"
alt
@click="imagePreview(index)"
>
</div>
js
export default {
name: "BugDetail",
data() {
return {
bugId: "",
bugDetail: {},
};
},
created() {
this.bugId = this.$route.query.bugId;
},
mounted() {
this.getBugDetail();
},
methods: {
getBugDetail() {
let data = {
id: this.bugId
};
API.getBugById(data)
.then(res => {
if (res.errCode == 0) {
this.bugDetail = res.data;
} else {
}
})
.catch(error => {});
},
},
components: {
}
};
查到原因了 把后台返回的链接由http换成https解决了这个问题 应该是微信安全策略导致的 具体原因还不清楚 如果有大神了解 麻烦解释下 目前来看跟我上面贴的代码关系不大