Dynamic prop/attr names
Offen
discussion
proposal
- Vorherrschende Sprache
- JavaScript
- Sterne
- 9k
- Forks
- 181
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Not the same as #109.
That would be useful to have insertable attribute names:
```js
html``
// same as
html``
```
## Practical cases
Optional attributes:
```js
html``
```
Private props:
```js
let html = htm.bind(h)
let _data = Symbol('data')
html``
function h (tag, props) {
props[_data]
}
```
Anonymous props:
```js
html``
function draggable(el) {
...
}
draggable[Symbol.toPrimitive] = () => 'data-draggable'
```
@developit @jviide would you consider that feature?
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.