如果我在AFRAME中动态附加一个组件,如下所示,则鼠标事件不起作用。(包装器是针对我正在处理的特定应用程序的。):
var temp = document.createElement('a-plane')
//set position, color, etc.
temp.setAttribute('some attribute that handles mouse events')
var wrapper = document.createElement('a-entity')
wrapper.appendChild(temp)
sceneEl.appendChild(wrapper)发布于 2018-02-05 11:34:16
实际上,问题是在设置没有要设置的变量的属性时,必须明确说明这一点。
因此,
temp.setAttribute('blah',{}) vs错误形式的temp.setAttribute('blah')
https://stackoverflow.com/questions/48511182
复制相似问题