We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Conditional attributes can be tough to work with.
Our current recommended practice is using Object.keys:
Object.keys
export default function MyElement ({ html, state }) { const { attrs } = state const disabled = Object.keys(attrs).includes('disabled') ? 'disabled' : '' return html`<button ${disabled}>I Can Haz?</button>` }
We should look into a helper to make this less cumbersome.
To keep in mind: there are attributes (e.g. many ARIA attributes) which are non-boolean.
See an example use case discussed in our Discord.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Conditional attributes can be tough to work with.
Our current recommended practice is using
Object.keys
:We should look into a helper to make this less cumbersome.
To keep in mind: there are attributes (e.g. many ARIA attributes) which are non-boolean.
See an example use case discussed in our Discord.
The text was updated successfully, but these errors were encountered: