求教 微信开发工具swiper 组件图片不显示问题?
发布于 7 年前 作者 wei65 2896 次浏览 来自 官方Issues

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

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

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

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

3 回复

图片路径错拉

你路径应该是错了吧

这个问题,我找到原因了,是我的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>

回到顶部