lit-analyzer icon indicating copy to clipboard operation
lit-analyzer copied to clipboard

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

Open aleclarson opened this issue 2 years ago • 0 comments

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>`
}

aleclarson avatar Nov 30 '23 06:11 aleclarson