小程序wepy框架引入vant.UI
在项目根目录npm i vant-weapp -S --production安装vant
下载安装完成后 去
node_modules/_vant_weapp
复制
dist文件夹到
src/components中
替换名称为van
在要使用vant的页面的config中配置usingComponents
config = {
navigationBarTitleText: "",
usingComponents: {
"van-button": "../components/van/button/index",
},
};
完成,开始使用
<template>
<view class="mass-to-user-box">
<van-button type="default">默认按钮</van-button>
<van-button type="primary">主要按钮</van-button>
<van-button type="warning">警告按钮</van-button>
<van-button type="danger">危险按钮</van-button>
</view>
</template>