美文网首页
vant-weapp+mpvue Component is no

vant-weapp+mpvue Component is no

作者: 前端丶安 | 来源:发表于2019-11-26 17:58 被阅读0次

vant-weapp+mpvue一直报这个错误 = > Component is not found in path "vant-weapp/dist/button/index"

解决方案

1.更换静态资源地址指向文本目录(和src同级)

  • 复制vant-weapp dist文件夹内容到static目录下 重命名 vant (随意取名)


    image.png
  • 页面main.json

{
    "usingComponents": {
        "van-button": "/static/vant/button/index"
    }
}
image.png

2.打开小程序的ES6转ES5

image.png

3.重新打开微信开发者工具 编译.

相关文章

网友评论

      本文标题:vant-weapp+mpvue Component is no

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