图片重复加载

发布于 6 年前作者 qianxia5573 次浏览最后编辑 6 年前来自 issues

本人用微信原生开发,

js文件中有host代表服务器地址,photo代表图片具体地址;

wxml文件中使用以下代码进行图片加载

<image src=‘{{host}}{{photo}}’ class=“photo”></image>

出现的现象控制台输出:VM3540:1 Failed to load image {{host}}

the server responded with a status of 404 (HTTP/1.1 404 Not Found) From server "{{host}} IP地址"但是图片正常显示;

个人推测问题在于 开发工具对图片加载了两次,一次加载{{host}},一次加载{{host}}{{photo}}

1 回复
guiyinglai
guiyinglai1 楼4 年前

控制台还有这样输出的?

VM3540:1 Failed to load image {{host}}the server responded with a status of 404 (HTTP/1.1 404 Not Found)  From server “{{host}} IP地址