snabbdom-pragma icon indicating copy to clipboard operation
snabbdom-pragma copied to clipboard

Is `h('div#id.class1.class2', ...)` needed ?

Open Swizz opened this issue 7 years ago • 2 comments

ATM, the sel property in Snabbdom-pragma is only related to the html element.

Snabbdom-JSX use something like the following code, to handle something they call Id and static classes (sel attribute)

<div selector="#id.class1.class2" />

Today, you can use the following code to achieve this

<div id="id" class={{ 'class1': true, 'class2': true }} />

So, Is this feature requested ?

Swizz avatar Apr 19 '17 12:04 Swizz

The following code is also working as intended

<div id="id" attrs-class="class1 class2" />

We can also aim to use

<div id="id" class={['class1', 'class2']} />

Swizz avatar Apr 19 '17 15:04 Swizz

https://github.com/JedWatson/classnames

Swizz avatar May 13 '17 06:05 Swizz