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-props/main.html

20 lines
319 B

{#each foo as bar}
<select on:change='handler(bar)'>
<option>a</option>
<option>b</option>
</select>
{/each}
<script>
export default {
data: () => ({ foo: [ 1, 2 ], log: [] }),
methods: {
handler ( bar ) {
let { log } = this.get();
log.push( bar );
this.set( { log } );
}
}
}
</script>