runem / lit-analyzer

Monorepository for tools that analyze lit-html templates
MIT License
314 stars 35 forks source link

Event listener props should allow an object with `handleEvent` method #332

Open aleclarson opened 7 months ago

aleclarson commented 7 months ago

See this page from the docs.

If you're not using decorators, you can customize event listener options by passing an object to the event listener expression. The object must have a handleEvent() method and can include any the options that would normally appear in the options argument to addEventListener().

render() {
  return html`<button @click=${{handleEvent: () => this.onClick(), once: true}}>click</button>`
}