Skip to content

Commit

Permalink
Remove outdated example from readme
Browse files Browse the repository at this point in the history
  • Loading branch information
StarLederer committed Apr 2, 2022
1 parent 97343ab commit 2595b34
Showing 1 changed file with 0 additions and 59 deletions.
59 changes: 0 additions & 59 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,65 +167,6 @@ await fetch(`${url}/path/to/somewhere?cmd=rm`, { method: 'DELETE' });
await fetch(`${url}/path/to/somewhere?cmd=rm&recursive=true&force=true`, { method: 'DELETE' });
```

## Example of displaying contents of a directory with a recursive Vue component

```vue
<!-- Dirent.vue -->
<script>
import { ref } from "vue";
export default {
name: "Dirent",
props: {
dir: String,
},
setup(props) {
const children = ref([]);
fetch(`http://localhost:7070${props.dir}?command=stat`)
.then((response) => response.json())
.then((a) => {
if (a.stats.dir) {
fetch(`http://localhost:7070${props.dir}`)
.then((response) => response.json())
.then((b) => {
children.value = b.items;
});
}
});
return {
children,
};
},
};
</script>
<template>
<li>
<span>{{ dir }}</span>
<ul>
<Dirent v-for="child in children" :dir="`${dir}/${child}`" />
</ul>
</li>
</template>
```

```vue
<!-- App.vue -->
<script>
import Dirent from "./components/Dirent.vue";
</script>
<template>
<ul>
<Dirent dir="/src" />
</ul>
</template>
```

## License

MIT

0 comments on commit 2595b34

Please sign in to comment.