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/flush-before-bindings/Nested.svelte

18 lines
438 B

<script>
import Visibility from './Visibility.svelte';
import counter from './counter.js';
export let things = ['first thing', 'second thing'];
export let visibilityMap = {};
function visibleThings() {
counter.count += 1;
return things.filter(text => visibilityMap[text]);
}
</script>
{#each things as thing}
<Visibility bind:isVisible="visibilityMap[thing]">
<p>{thing} ({visibilityMap[thing]})</p>
</Visibility>
{/each}