swiper中如何在图片上面显示文字

发布于 8 年前作者 liaoxiuying4119 次浏览最后编辑 8 年前来自 ask

   <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 回复
fangshen
fangshen1 楼6 年前

仅供参考

yuangang
yuangang2 楼6 年前

怎么都没人回答呢?

kxu
kxu3 楼6 年前

   <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>

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