给元素设置背景图,地址从data数据里拿,为什么会报错找不到图片呢?
- 需求的场景描述(希望解决的问题)
<view wx:for='{{name_tel}}'> <label for='{{item.id}}' style="background-image:url({{item.imgUrl}})"></label> <input id='{{item.id}}' type='text' placeholder='{{item.placeholder}}'></input> </view> |
- 希望提供的能力
这里label的背景图地址找不到,报错为:
Failed to load local image resource /pages/index/images/smapp_name.png
the server responded with a status of 404 (HTTP/1.1 404 Not Found)
