feat: hide anchor for now, flatten toc, refine docs
This commit is contained in:
parent
45a027b6cb
commit
736a27bf5e
@ -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>
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
[[ demo src="/demo/breadcrumb/size.vue" ]]
|
[[ demo src="/demo/breadcrumb/size.vue" ]]
|
||||||
|
|
||||||
### 使用内联 `BreadcrumbItem`
|
### 内联模式
|
||||||
|
|
||||||
直接内联 `BreadcrumbItem` 使用。
|
直接内联 `BreadcrumbItem` 使用。
|
||||||
|
|
||||||
|
@ -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.
|
||||||
|
|
||||||
|
@ -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}"/>
|
||||||
|
Loading…
Reference in New Issue
Block a user