mantou132 / gem

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

[gem] Use decorators instead constructor params #156

Open mantou132 opened 3 weeks ago

mantou132 commented 3 weeks 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

mantou132 commented 4 days ago

@async => @noblocking