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/binding-indirect-computed/main.html

27 lines
399 B

<select bind:value="selected.letter">
{{#each uppercase as letter}}
<option value="{{letter}}">{{letter}}</option>
{{/each}}
</select>
{{selected.letter}}
<script>
export default {
data() {
return {
letters: [
'a',
'b',
'c'
],
selected: {
letter: ''
}
}
},
computed:{
uppercase: letters => letters.map(x => x.toUpperCase())
}
};
</script>