Skip to content

Commit ce6a60a

Browse files
SkyBird233MingcongBai
authored andcommitted
feat(markdown detail): show date if showTitle is true
1 parent 3f10b30 commit ce6a60a

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/components/MarkdownDetail.vue

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ const route = useRoute();
2929
const loadError = shallowRef(false);
3030
const articleComponent = shallowRef();
3131
const articleComponentRef = useTemplateRef('articleComponentRef');
32-
const articleTitle = computed(
33-
() => articleComponentRef.value?.frontmatter.title
32+
const articleFrontmatter = computed(
33+
() => articleComponentRef.value?.frontmatter
3434
);
3535
3636
function loadArticle(slug) {
@@ -61,7 +61,8 @@ watch(
6161
<template v-else>
6262
<CategorySecond
6363
v-if="showTitle"
64-
:title="articleTitle ?? defaultTitle" />
64+
:title="articleFrontmatter?.title ?? defaultTitle"
65+
:right-text="articleFrontmatter?.date?.split('T')[0]" />
6566
<component
6667
ref="articleComponentRef"
6768
class="vuepress-markdown-body"

0 commit comments

Comments
 (0)