mantou132 / gem

💎 Lightweight WebApp development library using custom elements
https://gemjs.org
MIT License
19 stars 2 forks source link

[gem] Use decorators instead constructor params #156

Closed mantou132 closed 4 months ago

mantou132 commented 5 months ago

Easy to extends

@shadow()
@delegatesFocus()
@serializable()
@slotAssignment()
@focusable()
@async()
@role('button')
class MyElement extends GemElement {}
@shadow({ delegatesFocus: false }) // serializable/slotAssignment
@focusable()
@async()
@role('button')
class MyElement extends GemElement {}
@shadow({ delegatesFocus: false }) // serializable/slotAssignment
@focusable()
@async()
@aria({ role: 'button' })
class MyElement extends GemElement {}
@shadow(true) // serializable/slotAssignment
@focusable()
@async()
@aria('button') // label/ariaModal
class MyElement extends GemElement {}

add GemElement.config