尝试嵌入演示场景时:https://3d.io/docs/api/1/aframe-components.html - 我收到此错误:
Uncaught (in promise) ReferenceError: IO3D is not defined
at i.update (3dio.js:13912)
at i.updateProperties (component.js:267)
at HTMLElement.value (a-entity.js:539)
at e (a-entity.js:513)
at Array.forEach (<anonymous>)
at HTMLElement.value (a-entity.js:495)
at a-entity.js:306
at a-node.js:117
at <anonymous>
库已加载。我可以成功调用f.e.
IO3D.utils.services.call('Model.search', {...})
所以我觉得缺少显示框架组件的一些真正基本的东西?
我的环境:
https://3d.io 1.0.0-beta.22 (@master #274adf0 2017/08/02 10:16)
三.WebGLRenderer 84
A-Frame 版本:0.6.0(日期 2017 年 6 月 30 日,提交 #34d1988)
WebVR Polyfill 版本:^0.9.35
编辑:
通过脚本标签添加库就成功了!
非常感谢@geekonaut!
最佳答案
如果您使用的是 io3d
的 npm 版本,请确保在加载 io3d
之前导入 A-Frame。
控制台中应该有一条消息暗示该行为:
未找到 AFRAME 库:相关功能将被禁用。
由于该库可以在服务器端和客户端上使用,因此它会检测 A-Frame 是否存在,并且仅在存在情况下注册组件。
关于aframe - 在 : IO3D is not defined 中显示 aframe 结果,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45465776/