Phong Duong

🔎Search

Event handler in Svelte

13-08-2020 | #svelte

In Svelte, you use on: directive to listen to event on elements

<div on:mousemove={handleMousemove}>
  The mouse position is {m.x} x {m.y}
</div>

Share: TwitterFacebookLinkedInHacker News