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}
8 years ago
<select on:change='handler(bar)'>
<option>a</option>
<option>b</option>
</select>
{/each}
8 years ago
<script>
export default {
data: () => ({ foo: [ 1, 2 ], log: [] }),
methods: {
handler ( bar ) {
let { log } = this.get();
log.push( bar );
this.set( { log } );
}
}
}
</script>