求教 微信开发工具swiper 组件图片不显示问题?

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

刚接触微信开发工具,工具的版本是最新的,在使用swiper过程中,发现随便咋的就是图片显示不出来,如下图。

1、图片URL用绝对路径和直接用网络上的图片,都无法显示。

2、swiper的和其对应的容器宽度都有按网上的方法设置为100%,还是无法显示。

求教各位大神该如何最终解决呢?

3 回复
liliu
liliu1 楼6 年前

图片路径错拉

emao
emao2 楼6 年前

你路径应该是错了吧

tao24
tao243 楼6 年前

这个问题,我找到原因了,是我的swiper里少了一段image

改成下面这样就正常了

<swiper indicator-dots=“{{indicatorDots}}”

autoplay=“{{autoplay}}” interval=“{{interval}}”  duration=“{{duration}}”>

<block wx:for=“{{imageUrl}}”  wx:key=“*this” >

<swiper-item>

<view class=“swiper-item {{item}}” width=“355” height=“150”>

<image src=“{{item}}”> </image></view>

</swiper-item>

</block>

</swiper>