Repository navigation
Expand file tree
/
Copy path_Check.svelte
More file actions
59 lines (54 loc) · 1.36 KB
/
Copy path_Check.svelte
File metadata and controls
59 lines (54 loc) · 1.36 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<div>
<List
class="demo-list"
checkList
onSMUIListSelectionChange={(event) => (changeEvent = event)}
>
<Item>
<Label>Bruce Willis</Label>
<Meta>
<Checkbox bind:group={selected} value="Bruce Willis" />
</Meta>
</Item>
<Item>
<Label>Tom Hanks</Label>
<Meta>
<Checkbox bind:group={selected} value="Tom Hanks" />
</Meta>
</Item>
<Item>
<Label>Jack Nicholson</Label>
<Meta>
<Checkbox bind:group={selected} value="Jack Nicholson" />
</Meta>
</Item>
<Item>
<Label>Leonardo DiCaprio</Label>
<Meta>
<Checkbox bind:group={selected} value="Leonardo DiCaprio" />
</Meta>
</Item>
<Item>
<Label>Matt Damon</Label>
<Meta>
<Checkbox bind:group={selected} value="Matt Damon" />
</Meta>
</Item>
</List>
</div>
<pre class="status">Selected: {selected.join(', ')}</pre>
<pre class="status">Change Event Detail: {changeEvent
? JSON.stringify(changeEvent.detail)
: 'No change yet.'}</pre>
<script lang="ts">
import List, { Item, Meta, Label } from '@smui/list';
import Checkbox from '@smui/checkbox';
let selected = $state(['Tom Hanks']);
let changeEvent: CustomEvent<{ changedIndices: number[] }> | null =
$state(null);
</script>
<style>
* :global(.demo-list) {
max-width: 300px;
}
</style>