uview-ui报错:Component is not found in path node-modules/uview-ui/components/xx/xx

uview-ui报错:Component is not found in path node-modules/uview-ui/components/xx/xx

解决方法:

1、uview-ui如果是npm安装 需要在pages.json中添加easycom配置

"easycom": {
    
    
    "^u-(.*)": "uview-ui/components/u-$1/u-$1.vue"
  }

2、配置了以上还报错的话可能是 tempalte样式最外层没用标签包括着(只允许有一层用<view></view>包裹最外层)

3、如果试过方法还没解决的话,可以试试彻底关闭开发者工具关闭,重启

如你还有其他更好的解决方法,望告知,让我们一起进步!

猜你喜欢

转载自blog.csdn.net/weixin_43840289/article/details/129417577