-
-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property-attribute sync scheme #95
Conversation
@cwpeng |
Should we write updating code depending on arguments of attributeChangedCallback, not previous set property? I cannot make setAttribute("checked", false) work after setting it to true. |
True. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
Major changes of WComponent including:
attributes
object to encompass name, default value, observed, and parser function for easier dynamical parsing.getObservedAttributes
class function for getting observed attributes array.createGettersAndSetters
function for dynamically add getters & setters for all observed attributes.For more details, please refer to the code comments.
To test if this scheme is valid, please use w-checkbox & w-radio only for testing. (Other component will need to be revised to align with the new scheme to work.)