想知道如何引用js的type=module

此js放在html中,如我想用<script src=>引用,如何做到?

帮楼主修改了一下,为了避免ocr错误,保留原图

<script async src="/wp-content/uploads/2023/01/es-module-shims.js"></script>
    <script type="importmap">
             "imports": {
                     "three": "/wp-content/uploads/2023/01/three.module.js",
                     "three/addons/": "/wp-content/uploads/2023/01/"
   }
}
    </script>
<script type="module">
     import * as THREE from 'three';
     import { OrbitControls } from 'three/addons/OrbitControls.js';

代码的话,用引用,不要用截图

thanks

好的。

<script type="module" src="/wp-content/uploads/2023/01/three.module.js"></script>
<script type="module" src="/wp-content/uploads/2023/01/OrbitControls.js"></script>
...

AI 转换修改而来……

这类脚本标准做法是传主题目录下,而不是作为附件上传……