-
-
Notifications
You must be signed in to change notification settings - Fork 284
/
Copy path_MultiLevel.svelte
53 lines (49 loc) · 1.33 KB
/
_MultiLevel.svelte
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
<div>
<List class="demo-list">
<Item onSMUIAction={() => (clicked = 'Level 1 - 1')}>
<Text>Level 1 - 1</Text>
</Item>
<Item onSMUIAction={() => (clicked = 'Level 1 - 2')}>
<Text>Level 1 - 2</Text>
</Item>
<Item onSMUIAction={() => (clicked = 'Level 1 - 3')}>
<Text>Level 1 - 3</Text>
</Item>
<Item wrapper>
<List class="sub-list">
<Item onSMUIAction={() => (clicked = 'Level 2.1 - 1')}>
<Text>Level 2.1 - 1</Text>
</Item>
<Item onSMUIAction={() => (clicked = 'Level 2.1 - 2')}>
<Text>Level 2.1 - 2</Text>
</Item>
</List>
</Item>
<Item onSMUIAction={() => (clicked = 'Level 1 - 4')}>
<Text>Level 1 - 4</Text>
</Item>
<Item wrapper>
<List class="sub-list">
<Item onSMUIAction={() => (clicked = 'Level 2.2 - 1')}>
<Text>Level 2.2 - 1</Text>
</Item>
<Item onSMUIAction={() => (clicked = 'Level 2.2 - 2')}>
<Text>Level 2.2 - 2</Text>
</Item>
</List>
</Item>
</List>
</div>
<pre class="status">Clicked: {clicked}</pre>
<script lang="ts">
import List, { Item, Text } from '@smui/list';
let clicked = $state('nothing yet');
</script>
<style>
* :global(.demo-list) {
max-width: 300px;
}
* :global(.sub-list) {
padding-left: 10px;
}
</style>