FWQ
使用 unpkg 导入 three.js 时,为什么在 main.js 中无法识别 THREE?
通过 unpkg 引入 three.js 您希望通过 unpkg 在没有任何前端框架的情况下导入 three.js。然而,在您的代码中,您在 mn.js 中无法识别 THREE。 出现此错误是因为您尚未在 index.html 中正确导入 THREE 模块。要解决此问题,请进行以下更改: 使用 importmap 引入 three.js 模块: index.html <script type="importmap"> { "imports": { "three":…