问题
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