mirror of https://github.com/sveltejs/svelte
Merge pull request #2349 from Panya/issue-2348
Pass block to the render of an expression in an attributepull/2364/head
commit
c853e44130
@ -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