Skip to content

Commit dab83f1

Browse files
committed
fix: computed 를 사용해서 showHeader 값을 reactive 하게 가져오도록 수정
1 parent b2edc6f commit dab83f1

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/PostLayout/PostLayout.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
<script setup>
22
import { useData } from "vitepress";
3+
import { computed } from "vue";
34
import DefaultTheme from "vitepress/theme";
45
import PostComment from "@/components/PostComment/PostComment.vue";
56
import PostHeader from "@/components/PostHeader/PostHeader.vue";
67
const { Layout } = DefaultTheme;
78
89
const { frontmatter } = useData();
910
10-
const showHeader = Boolean(frontmatter.value.title);
11-
const showComments = frontmatter.value.comment === true;
11+
const showHeader = computed(() => Boolean(frontmatter.value.title));
12+
const showComments = computed(() => frontmatter.value.comment === true);
1213
</script>
1314

1415
<template>

0 commit comments

Comments
 (0)