swiper中如何在图片上面显示文字
发布于 6 年前 作者 liaoxiuying 3947 次浏览 来自 问答

   <swiper class=“top-bar” indicator-dots=“true” autoplay=“true” 

    indicator-color="#fff" indicator-active-color="#00BFFF" circular=“true”>

      <block wx:for="{{navlist}}" wx:key="">

         <swiper-item>

            <image src="{{item}}" class=“swiper_img”/>

            <text class=“swiper_text”>文字内容</text>

         </swiper-item>

      </block>

   </swiper>

想在图片上显示文字,是要自己去调这个text的位置吗?

3 回复

怎么都没人回答呢?

   <swiper class=“top-bar” indicator-dots=“true” autoplay=“true” indicator-color="#fff" indicator-active-color="#00BFFF" circular=“true”>

      <block wx:for="{{navlist}}" wx:key="">

         <swiper-item>

            <navigator class=“swiper_nav” style=“background-image: url({{item}});”>

            <text class=“nav_text”>海贼王{{index}}</text>

            </navigator>

         </swiper-item>

      </block>

   </swiper>

自己通过设置背景图的方式解决。还是感谢楼上的!

回到顶部