Closed vinyll closed 2 years ago
Today attribute must be one word:
<my-user firstname="John"></my-user>
We may need to consider hyphened attributes, which are HTML compliant:
<my-user first-name="John"></my-user>
A proposal would be to access this property in camelCase:
bricks/my-user.html
<script> <template> <p :if="state.firstName">Hello ${state.firstName}</p> </template> init() { this.state = { firstName: "" } } </script>
It might need to be set in the setAttribute() extended function if it the __attributesToState() is not enough.
setAttribute()
__attributesToState()
fixed in 1.7.0.
passing an attribute as <x-user first-name="John"></x-user> will make it reactively available to state as state.firstName.
<x-user first-name="John"></x-user>
state.firstName
Today attribute must be one word:
We may need to consider hyphened attributes, which are HTML compliant:
A proposal would be to access this property in camelCase:
bricks/my-user.html
It might need to be set in the
setAttribute()
extended function if it the__attributesToState()
is not enough.