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

View File

@ -18,7 +18,7 @@
[[ demo src="/demo/breadcrumb/size.vue" ]] [[ demo src="/demo/breadcrumb/size.vue" ]]
### 使用内联 `BreadcrumbItem` ### 内联模式
直接内联 `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" ]] [[ demo src="/demo/breadcrumb/size.vue" ]]
### Using inline `BreadcrumbItem`s ### Inline usage
Can be used with embedded `BreadcrumbItem`s. Can be used with embedded `BreadcrumbItem`s.

View File

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