Skip to content

Commit 8779095

Browse files
authored
Merge pull request #17076 from munrocket/dev
misinformation in docs about modules
2 parents ca5f12b + 83d283c commit 8779095

File tree

2 files changed

+7
-13
lines changed

2 files changed

+7
-13
lines changed

docs/manual/en/introduction/Loading-3D-models.html

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -92,18 +92,15 @@ <h2>Loading</h2>
9292
// commonjs
9393
var THREE = window.THREE = require('three');
9494
require('three/examples/js/loaders/GLTFLoader');
95-
</code>
9695

97-
<p>
98-
Currently three.js examples are not available as ES modules (import &hellip; from '&hellip;').
99-
Several workarounds are discussed in
100-
<a href="https://github.com/mrdoob/three.js/issues/9562" target="_blank" rel="noopener">#9562</a>.
101-
</p>
96+
// ES modules
97+
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
98+
</code>
10299

103100
<p>
104101
Once you've imported a loader, you're ready to add a model to your scene. Syntax varies among
105102
different loaders — when using another format, check the examples and documentation for that
106-
loader. For glTF, basic usage would be:
103+
loader. For glTF, usage with global scripts would be:
107104
</p>
108105

109106
<code>

docs/manual/zh/introduction/Loading-3D-models.html

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,10 @@ <h2>加载</h2>
7979
// commonjs
8080
var THREE = window.THREE = require('three');
8181
require('three/examples/js/loaders/GLTFLoader');
82-
</code>
8382

84-
<p>
85-
目前three.js示例不能作为ES modules (import &hellip; from '&hellip;')来使用。
86-
这里讨论了一些解决方法:
87-
<a href="https://github.com/mrdoob/three.js/issues/9562" target="_blank" rel="noopener">#9562</a>.
88-
</p>
83+
// ES modules
84+
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
85+
</code>
8986

9087
<p>
9188
一旦你引入了一个加载器,你就已经准备好为场景添加模型了。不同加载器之间可能具有不同的语法 ——

0 commit comments

Comments
 (0)