程序员的资源宝库

网站首页 > gitee 正文

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

sanyeah 2024-03-29 15:21:19 gitee 9 ℃ 0 评论

 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>

 

Tags:

本文暂时没有评论,来添加一个吧(●'◡'●)

欢迎 发表评论:

最近发表
标签列表