欢迎您访问 最编程 本站为您分享编程语言代码,编程技术文章!
您现在的位置是: 首页

小程序使用 vant weapp 实现旋转图表

最编程 2024-03-20 16:39:23
...

实现步骤

首先我们需要在小程序中安装vant weapp组件

vant weapp是转为小程序设计的vant组件,地址链接已经贴出来了

小程序引入组件
npm i vant-weapp -S --production
在需要使用的页面page.json文件中引入组件
页面wxml使用
<swiper 
    class="home-swiper"
		indicator-dots="true" 
		autoplay="true" 
    interval="5000"
    duration="1000"
    indicator-color="#bfbfbf"
    indicator-active-color="#00ACED"
  >
    <block wx:for="{{bannerList}}">
      <swiper-item>
        <image src="{{item.imgurl}}" style="width: 100%;height: 100%;border-radius: 10px;"></image>
      </swiper-item>
    </block>
  </swiper>