feat: hide anchor for now, flatten toc, refine docs

This commit is contained in:
Justineo
2021-10-26 16:40:44 +08:00
parent 45a027b6cb
commit 736a27bf5e
4 changed files with 9 additions and 5 deletions

View File

@@ -1,7 +1,7 @@
<template>
<nav class="one-toc">
<veui-anchor
:items="items"
:items="flattenItems"
sticky
/>
</nav>
@@ -17,6 +17,11 @@ export default {
},
props: {
items: Array
},
computed: {
flattenItems () {
return this.items.flatMap(({ children }) => children || [])
}
}
}
</script>