【发布时间】:2019-02-02 09:54:27
【问题描述】:
我在 Angular6 应用程序中使用“three.js”和“three-decal-geometry”。进口见下文:
import * as THREE from 'three';
import * as OBJLoader from 'three-obj-loader';
import * as DecalGeometry from 'three-decal-geometry';
OBJLoader(THREE);
当我尝试调用 THREE.DecalGeometry 时,我收到以下错误消息:
Property 'DecalGeometry' does not exist on type 'typeof "..node_modules/@types/three/index"'.
Did you mean 'DirectGeometry'?
我的 package.json:
"dependencies": {
"@angular/cdk": "^6.2.0",
"three": "^0.84.0",
"three-decal-geometry": "^1.0.0",
"three-obj-loader": "^1.1.3"
}
"devDependencies": {
"@types/three": "^0.92.15",
"@angular/cli": "~6.0.7",
}
我不知道为什么我不能使用 DecalGeometry 库。我做了 npm i 三贴花几何,甚至尝试包括
<script src="THREE.DecalGeometry.js" ></script>
按照https://www.npmjs.com/package/three-decal-geometry 的指示在 index.html 中
【问题讨论】:
标签: typescript three.js typescript-typings