File tree 1 file changed +0
-52
lines changed
packages/svelte-file-tree
1 file changed +0
-52
lines changed Original file line number Diff line number Diff line change @@ -7,55 +7,3 @@ Unstyled file tree component library for Svelte.
7
7
``` bash
8
8
npm install svelte-file-tree
9
9
```
10
-
11
- ## Usage
12
-
13
- ``` svelte
14
- <script lang="ts">
15
- import { FileTree, Tree, TreeItem, TreeItemInput } from "svelte-file-tree";
16
-
17
- const tree = new FileTree();
18
- tree.nodes = [
19
- tree.createFolder({
20
- id: "1",
21
- name: "Section 1",
22
- children: [
23
- tree.createFile({
24
- id: "1.1",
25
- name: "Section 1.1",
26
- }),
27
- tree.createFile({
28
- id: "1.2",
29
- name: "Section 1.2",
30
- }),
31
- ],
32
- }),
33
- tree.createFolder({
34
- id: "2",
35
- name: "Section 2",
36
- children: [
37
- tree.createFile({
38
- id: "2.1",
39
- name: "Section 2.1",
40
- }),
41
- tree.createFile({
42
- id: "2.2",
43
- name: "Section 2.2",
44
- }),
45
- ],
46
- }),
47
- ];
48
- </script>
49
-
50
- <Tree {tree}>
51
- {#snippet item({ node, editing })}
52
- <TreeItem editable draggable>
53
- {#if editing}
54
- <TreeItemInput />
55
- {:else}
56
- <span>{node.name}</span>
57
- {/if}
58
- </TreeItem>
59
- {/snippet}
60
- </Tree>
61
- ```
You can’t perform that action at this time.
0 commit comments