What's the difference between id and localId in Apache Royale?

扶醉桌前 提交于 2021-01-27 17:49:39

问题


In Apache Royale we can identify objects with "id" and "localId" properties. The problem is to know why we have two ways of doing the same apparently.


回答1:


I found the Answer and sharing solution:

HTML requires ID's that are unique, so by creating Royale components that internally use ID's to identify the inner sub-components this means the same ID will be used in all instances created and therefore generating a problem of lack of uniqueness.

Solution:
Use "localId" in the inner components, so Royale will use it internally and will avoid to add "id" when you transpile to HTML.



来源:https://stackoverflow.com/questions/55923924/whats-the-difference-between-id-and-localid-in-apache-royale

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!