dcloudio / uni-app

A cross-platform framework using Vue.js
https://uniapp.dcloud.io
Apache License 2.0
40.19k stars 3.64k forks source link

easycom 不支持原生组件 #3531

Closed xiaoxiangmoe closed 2 years ago

xiaoxiangmoe commented 2 years ago

问题描述 [问题描述:尽可能简洁清晰地把问题描述清楚] https://github.com/xiaoxiangmoe/issue-uniapp-easycom-miniapp-component-support.git

复现步骤 [复现问题的步骤]

  1. git clone https://github.com/xiaoxiangmoe/issue-uniapp-easycom-miniapp-component-support.git
  2. cd issue-uniapp-easycom-miniapp-component-support
  3. yarn dev:mp-alipay
  4. 发现错误 [或者可以直接贴源代码]

无报错

实际结果

[vite]: Rollup failed to resolve import "/mycomponents/ali-hello/index" from "src/pages/index/index.vue".
This is most likely unintended because it can break your application at runtime.
If you do want to externalize this module explicitly add it to
`build.rollupOptions.external`

系统信息:

补充信息 [可选] [根据你的分析,出现这个问题的原因可能在哪里?]

可能与 uniapp v3 暂时不支持局部引入原生组件有关。

xiaoxiangmoe commented 2 years ago

@fxy060608 求帮忙看看。

fxy060608 commented 2 years ago

小程序组件要使用pages.json中的usingComponents引入