Skip to content

Commit

Permalink
feat: Implemented is-title-shown-with-no-content prop
Browse files Browse the repository at this point in the history
  • Loading branch information
hanyujie2002 committed Sep 21, 2024
1 parent 292eb0d commit 6621df2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/runtime/components/TableOfContents.vue
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
:only="['body']"
find="one"
>
<span id="toc-title">{{ props.title }}</span>
<span v-if="(data.body.toc && data.body.toc.links) || isTitleShownWithNoContent" id="toc-title">{{ props.title }}</span>
<ul
v-if="data.body.toc && data.body.toc.links"
id="toc-container"
Expand Down Expand Up @@ -64,6 +64,10 @@ const props = defineProps({
type: Boolean,
default: true,
},
isTitleShownWithNoContent: {
type: Boolean,
default: false,
},
title: {
type: String,
default: 'Table of Contents',
Expand Down

0 comments on commit 6621df2

Please sign in to comment.