You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte/test/js/samples/event-modifiers/input.svelte

16 lines
409 B

<script>
function handleTouchstart() {
// ...
}
function handleClick() {
// ...
}
</script>
<div on:touchstart={handleTouchstart}>
<div on:touchstart|nonpassive={handleTouchstart}>touch me</div>
<button on:click|stopPropagation|preventDefault={handleClick}>click me</button>
<button on:click|once|capture={handleClick}>or me</button>
<button on:click|capture={handleClick}>or me!</button>
</div>