小程序运行报错:“Failed to load local image resource xxx.png the server responded with?
错误原因:由于这是因为初始化的时候,变量还没渲染进去导致的。解决方法:在src前面加个:wx:if<image wx:if='{{customerLevel.value}}' class="iconLevel" src='{{customerLevel.value?tools.getLevel(customerLevel.value):"请选择"
·
错误原因:
由于这是因为初始化的时候,变量还没渲染进去导致的。
解决方法:
在src前面加个:
wx:if<image wx:if='{{customerLevel.value}}' class="iconLevel" src='{{customerLevel.value?tools.getLevel(customerLevel.value):"请选择"}}'></image>
或者直接写 /static/img/xx.png,比如:把图片放在根目录下的static文件下
<img src="/static/img/bg.png" >
更多推荐
已为社区贡献1条内容
所有评论(0)