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/runtime/samples/select-change-handler/main.svelte

16 lines
345 B

<script>
export let selected;
export let options;
export let lastChangedTo;
export function updateLastChangedTo(result) {
lastChangedTo = result;
}
</script>
<select bind:value={selected} on:change="{() => updateLastChangedTo(selected)}">
{#each options as option}
<option value="{option.id}">{option.id}</option>
{/each}
</select>