微信小程序WeUI组件,通过 useExtendedLib 扩展库 的方式引入后总提示“未找到”,完整解决方案

错误解读

…/components/cells/cells" 未找到
很明显插件导入失败,只需要更换导入方式即可

  • 错误示范
	{
     
  "navigationBarTitleText": "确认订单",
  "usingComponents": {
     
    "mp-icon": "weui-miniprogram/icon/icon",
    "mp-cells": "../components/cells/cells",
    "mp-cell": "../components/cell/cell",
    "choose-number" : "/component/choose-number/chooseNumber"
  }
}

此时就会报错,xxxx未找到

正确的引入方式是:

{
     
  "navigationBarTitleText": "确认订单",
  "usingComponents": {
     
    "mp-icon": "weui-miniprogram/icon/icon",
    "mp-cells": "/miniprogram_npm/weui-miniprogram/cells/cells",
    "mp-cell": "/miniprogram_npm/weui-miniprogram/cell/cell",
    "choose-number" : "/component/choose-number/chooseNumber"
  }
}

把 ../components 改为 /miniprogram_npm/weui-miniprogram

你可能感兴趣的:(前端学习笔记,解决方案,小程序,weui)