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

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

 

posted @ 2018-12-21 13:27  Yuri_trender  阅读(1164)  评论(0编辑  收藏  举报