Skip to content

Commit c78e660

Browse files
authored
Merge pull request #45 from abdel-17/v0.1.0
v0.1.0
2 parents 14bbee5 + 308cc2d commit c78e660

File tree

2 files changed

+5
-52
lines changed

2 files changed

+5
-52
lines changed

.changeset/bitter-turkeys-shave.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"svelte-file-tree": minor
3+
---
4+
5+
Add Change Callbacks

packages/svelte-file-tree/README.md

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -7,55 +7,3 @@ Unstyled file tree component library for Svelte.
77
```bash
88
npm install svelte-file-tree
99
```
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-
```

0 commit comments

Comments
 (0)