在mpvue中引用vant weapp

在mpvue中引用vant weapp

使用mpvue作为框架,引入第三方的ui框架 vant-weapp

vant-weapp: https://github.com/youzan/vant-weapp

下载vant-weapp的资源:https://github.com/youzan/vant-weapp.git

1、67108be6122fad1efe5e8e1b2f4dd817164.jpg

2、edfb3e83d3ea6f36ab555614b7158d4da29.jpg

3、fdf0f6e693bccf46fa37078e84184ff8109.jpg

4、全选复制

5、进入自己的项目的static文件夹

6、新建一个vant文件夹

665e3586f60c2545da2b86fbd4f72ae8b4b.jpg

7、把刚才复制的所有东西,丢进去

8、项目如图:2a0f925f79002e7483b2042752aa62ba4b8.jpg

9、单个页面中创建main.json文件

66d313f2edbf70abda6196ac65fed539cd0.jpg

10、使用的组件名称引入

  1.  
    {
  2.  
    "usingComponents": {
  3.  
    "van-button": "/static/vant/button/index",
  4.  
    "van-cell": "/static/vant/cell/index",
  5.  
    "van-cell-group": "/static/vant/cell-group/index",
  6.  
    "van-popup": "/static/vant/popup/index",
  7.  
    "van-datetime-picker": "/static/vant/datetime-picker/index",
  8.  
    "van-field": "/static/vant/field/index",
  9.  
    "van-picker": "/static/vant/field/index",
  10.  
    "van-dialog": "/static/vant/dialog/index",
  11.  
    "van-toast": "/static/vant/toast/index"
  12.  
    }
  13.  
    }
  1.  
    <van-cell title="姓名" is-link>
  2.  
    <div>
  3.  
    <input type="text">
  4.  
    </div>
  5.  
    </van-cell>

-------------------------------------分割线------------------------------------------------------------

 

转载于:https://my.oschina.net/u/3883810/blog/3025120

posted @ 2021-10-08 13:57  前端白雪  阅读(156)  评论(0编辑  收藏  举报