引入Vant Weapp组件
- 在components文件夹下面引入组件
- 在app.json下配置全局组件
{
"pages": [
"pages/index/index",
"pages/mine/index"
],
"usingComponents": {
"van-button": "components/vant-weapp/dist/button/index"
},
"window": {
"backgroundTextStyle": "light",
"navigationBarBackgroundColor": "#fff",
"navigationBarTitleText": "Weixin",
"navigationBarTextStyle": "black"
},
"style": "v2",
"sitemapLocation": "sitemap.json"
}
- 在页面中使用即可
<van-button type="primary">按钮</van-button>