You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
So technically your ideal/expected result is actually unexpected behavior. The documentation on the attr function literally says:
Set attributes on the current active tag context
So in essence what you're doing when you call attr(className = "bar") you're quite literally setting className(class) to "btn" then when you call it again with attr(className = "baz") it's literally setting className(class) to "baz".
What you'd really want is the addition of a function along the lines of append_attribute or something, which adds to a current attribute if it exists or falls back to just setting the attribute if it doesn't exist.
For example, I'd expect the following to generate
<button class="bar baz">foo</button>
:Accumulating is nice for proving a "base component" with a set of "base classes" that an end user could add to, for example:
Would ideally generate
The text was updated successfully, but these errors were encountered: