简体   繁体   English

aframe 创建复杂元素

[英]aframe create complex element

I have no problem with createElement('a-whatever');我对 createElement('a-whatever'); 没有任何问题;

but with the situation like (from the NPM registry) :但是在这种情况下(来自 NPM 注册表):

less than sign quote a-entity arrow or less than sign quote a-entity mountain小于符号引用a-实体箭头或小于符号引用a-实体山

then when I put in the correct scripts in the header of the HTML,然后当我在 HTML 的标题中放入正确的脚本时,

things work if I put in: less than sign quote a-entity arrow or less than sign quote a-mountain;如果我输入:小于符号引用 a-实体箭头或小于符号引用 a-山,事情就会起作用;
but i need to create many mountains/arrows/particles depending on conditions,但我需要根据条件创建许多山脉/箭头/粒子,

so using javascript createElement so far nothing works所以到目前为止使用 javascript createElement 没有任何效果

ie. IE。 createElement('a-entity arrow'); createElement('a-实体箭头');

or或者

createElement('entity') createElement('实体')

then if I try less than sign quote a-eneity and try to set attributes of spe-particles or layout;然后,如果我尝试小于符号引用 a-eneity 并尝试设置 spe-particles 或 layout 的属性; nothing gets created什么都没有被创造

Question is not completely clear.问题不完全清楚。 Provide code and link to reproduce.提供代码和链接来重现。 Below syntax to create entities and set components:以下语法用于创建实体和设置组件:

var entityEl = document.createElement('a-entity');
entityEl.setAttribute('arrow', {attributeName: value});

Additional info in docs 文档中的附加信息

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM