先放出來Vant UI 的官方文檔 https://youzan.github.io/vant-weapp/#/changeloggit
最簡單的方法,直接下載Vant UI 或者是git clone https://github.com/youzan/vant-weapp.git
git倉庫的網址:https://github.com/youzan/vant-weapp
下載完成以後找到dist文件夾放到微信小程序根目錄下按需引入便可
路徑設置:github
"usingComponents": { "van-button": "/path/to/vant-weapp/dist/button/index" }
裏面的"/path/to/vant-weapp/dist"的路徑根據實際的路徑修改npm
// 在微信小程序根目錄下初始化文檔 npm init // 安裝Vant包 npm i vant-weapp -S --production
路徑設置:小程序
"usingComponents": { "van-button": "/path/to/vant-weapp/dist/button/index" }
裏面的"/path/to/vant-weapp/dist"的路徑根據實際的路徑修改微信小程序
若是出現這種錯誤ruby
VM6419:5 ./miniprogram_npm/_vant-weapp@0.5.12@vant-weapp/action-sheet/index.wxml ../wxs/utils.wxs not found from ./miniprogram_npm/_vant-weapp@0.5.12@vant-weapp/action-sheet/index.wxml > 1 | <wxs src="../wxs/utils.wxs" module="utils" /> | ^ 2 | 3 | <van-popup 4 | show="{{ show }}"
解決方法:你只須要把構建出來的miniprogram_npm/vant-weapp文件夾裏的內容都刪除,以後再https://github.com/youzan/vant-weapp下載一份Vant UI,將dist文件夾中的文件複製到 miniprogram_npm/vant-weapp(即下載一份Vant,以後替換掉項目中的文件)以後保存便可解決bash