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
Array type for properties values #312
Comments
My take is that adding |
Just come back after thinking about template strings. div({ class: 'tags' },
span({ class: `tag ${config.persistence ? 'is-success' : 'is-warning'}` }, 'Persistence'),
span({ class: `tag ${config.serviceWorker ? 'is-success' : 'is-warning'}` }, 'Service Worker')
) This library is definitely perfect as it is. Thanks for your work ! I close this issue. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi !
I'm currently working with your excellent library and Bulma CSS.
As Bulma is based on CSS classes, it can require many values in the class property.
A simple example here, with a tag color depending on a flag:
To prevent repeating the constant values, we can use an array and the join function:
But I like VanJS because it allows to write components in pure JS in a declarative way. A bit more of syntactic sugar can't hurt !
Allowing Array values by joining can do the job:
What about that ?
The text was updated successfully, but these errors were encountered: