打开项目终端,初始化

npm init  —— 一直回车,直到出现yes——yes——回车

安装包

npm i vant-weapp -S --production

开发者工具——左上角工具 = 构建npm 这一项,点击进行构建。

开发者工具——左上角设置 = 项目设置——勾选使用npm模块

然并卵  总是丢失文件  报错

方法二

npm i vant-weapp -S --production
把dist文件剪切出来放在项目任意位置
页面使用,
json文件

"usingComponents": {    "van-button": "/utils/dist/button/index"  }页面文件 van-button type="warning"警告按钮/van-button

TAG标签: 微信小程序卸载npm

http://www.xiaochengxub.com/read-105070.html