小程序 安装 vant 引入报错

小程序是最新版的,安装van流程

1:打开小程序的文件 npm init  然后下载 

# 通过 npm 安装 npm i vant-weapp -S --production

# 通过 yarn 安装 yarn add vant-weapp --production

然后在小程序中工具中`构建npm` 

在文件.json 中引入

{
  "usingComponents": {
    "van-button": "vant-weapp/button"
    }
}

  页面引入

<van-button type="default">默认按钮</van-button>
测试成功!!!
注意顺序一定不能错!!!

猜你喜欢

转载自www.cnblogs.com/damai/p/11111367.html