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.
32 lines
529 B
32 lines
529 B
6 years ago
|
<script>
|
||
|
import { slide } from 'svelte/transition';
|
||
|
|
||
|
let showItems = true;
|
||
|
let i = 5;
|
||
|
let items = ['one', 'two', 'three', 'four', 'five', 'six', 'seven', 'eight', 'nine', 'ten'];
|
||
|
</script>
|
||
|
|
||
|
<label>
|
||
1 year ago
|
<input type="checkbox" bind:checked={showItems} />
|
||
6 years ago
|
show list
|
||
|
</label>
|
||
|
|
||
|
<label>
|
||
1 year ago
|
<input type="range" bind:value={i} max="10" />
|
||
6 years ago
|
</label>
|
||
|
|
||
|
{#if showItems}
|
||
|
{#each items.slice(0, i) as item}
|
||
|
<div transition:slide>
|
||
|
{item}
|
||
|
</div>
|
||
|
{/each}
|
||
4 years ago
|
{/if}
|
||
|
|
||
|
<style>
|
||
|
div {
|
||
|
padding: 0.5em 0;
|
||
|
border-top: 1px solid #eee;
|
||
|
}
|
||
1 year ago
|
</style>
|