美文网首页
uniapp微信小程序使用Vant Weappui框架方法

uniapp微信小程序使用Vant Weappui框架方法

作者: 小李不小 | 来源:发表于2021-08-26 23:13 被阅读0次

    1. 在根目录下创建wxcomponents,wxcomponents下建文件夹vant

    2.项目引入

    1.在https://github.com/youzan/vant-weapp下载最新的zip压缩包
    2.解压,将里面的dist文件放到vant里面

    image

    3.在App.vue中引入UI样式

    image

    @import "/wxcomponents/vant/dist/common/index.wxss";

    4.在pages里面定义引入的组件

           ![image](https://img.haomeiwen.com/i16629650/602209476a1dd21f.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)
    
    "usingComponents":{
    
      "van-button": "/wxcomponents/vant/dist/button/index"
    
    }
    

    5.在组件中使用

    https://youzan.github.io/vant-weapp/#/button和官网的使用方法一样。

    如果报错找不到文件位置,关闭hbuider和微信小程序重启一下

    相关文章

      网友评论

          本文标题:uniapp微信小程序使用Vant Weappui框架方法

          本文链接:https://www.haomeiwen.com/subject/bcepiltx.html