mirror of https://github.com/sveltejs/svelte
parent
e3c0887afc
commit
609084fb3e
@ -0,0 +1,12 @@
|
|||||||
|
export default {
|
||||||
|
html: `
|
||||||
|
<select>
|
||||||
|
<option value="">please choose</option>
|
||||||
|
<option value="1">1</option>
|
||||||
|
<option disabled="" value="2">2</option>
|
||||||
|
<option value="3">3</option>
|
||||||
|
<option disabled="" value="4">4</option>
|
||||||
|
<option value="5">5</option>
|
||||||
|
</select>
|
||||||
|
`
|
||||||
|
};
|
@ -0,0 +1,11 @@
|
|||||||
|
<script>
|
||||||
|
let available = [1, 2, 3, 4, 5];
|
||||||
|
let taken = [2, 4];
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<select>
|
||||||
|
<option value="">please choose</option>
|
||||||
|
{#each available as a}
|
||||||
|
<option disabled="{!!taken.find(f => f == a)}" value="{a}">{a}</option>
|
||||||
|
{/each}
|
||||||
|
</select>
|
Loading…
Reference in new issue