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
No known key found for this signature in database
GPG Key ID: B73F0979CF18A0EA
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>

View File

@ -18,7 +18,7 @@
[[ demo src="/demo/breadcrumb/size.vue" ]]
### 使用内联 `BreadcrumbItem`
### 内联模式
直接内联 `BreadcrumbItem` 使用。

View File

@ -18,7 +18,7 @@ Available size variants for the [`ui`](#props-ui) prop: `s` / `m`.
[[ demo src="/demo/breadcrumb/size.vue" ]]
### Using inline `BreadcrumbItem`s
### Inline usage
Can be used with embedded `BreadcrumbItem`s.

View File

@ -1,6 +1,5 @@
<template>
<article ref="article" class="content ${style}"><!-- if: ${toc} -->
<one-toc :items="toc"/><!-- /if -->
<article ref="article" class="content ${style}">
${content | raw}
<section class="meta">
<one-edit-link path="${path}"/>