wepy-cli 开发小程序如何使用vant组件

时间:2022-09-07 22:41:20
 同样使用wepy-cli快速生成的小程序,目前可以使用组件:
直接通过 git 下载 Vant Weapp 源代码,并将dist目录拷贝到自己的项目中
git clone https://github.com/youzan/vant-weapp.git
将dist/目录拷贝到项目src/components/目录下面(根据自己目录结构调整)。
在页面test.wpy中的config字段使用
config = {
usingComponents: {
'van-popup': '../../components/dist/popup/index'
}
}
使用,页面中:
<van-popup show="{{ show }}" bind:close="onClose">内容</van-popup>