mirror of https://github.com/sveltejs/svelte
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.
20 lines
323 B
20 lines
323 B
7 years ago
|
{{#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>
|