前言
添加一些微信小程序常用到的功能
一、UI框架
一般我用VantUI二、Vant使用步骤
1.安装
- 通过 npm 安装
1npm i @vant/weapp -S --production
2 修改 app.json,将"style": "v2"删掉
3 小程序中在‘‘详情’ -使用npm勾选 - 在文件夹中的json文件中引入所需要的配置文件
.
2.轮播图
代码如下(示例):
<view class="search_img">
<swiper autoplay="true" interval="2000" indicatorDots="true" duration="500" circular="true">
<swiper-item>
<image src="http://img.guyongrensheng.com/uploads/other/20210609/90c32bff451914ef267ee5bd7554bd9a.png"></image>
</swiper-item>
<swiper-item>
<image src="http://img.guyongrensheng.com/uploads/other/20210605/f3200b019d731fcff47d05e4366a8d8a.png"></image>
</swiper-item>
<swiper-item>
<image src="http://img.guyongrensheng.com/uploads/other/20210609/d8c4d5039e4cdcb9792e84b76f0150d3.png"></image>
</swiper-item>
<swiper-item>
<image src="http://img.guyongrensheng.com/uploads/other/20210609/8ea3f815f64af9dd31b3f638cde5b10e.png"></image>
</swiper-item>
</swiper>
</view>
总结
记录一下在项目中用到的一些功能