Skip to content

Commit

Permalink
fix: allow undefined for pageData.value
Browse files Browse the repository at this point in the history
  • Loading branch information
YunYouJun committed Dec 18, 2024
1 parent 72f6fab commit 72ac100
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ export function injectPageDataCode(pageData: PageData) {
'const { data: pageData } = usePageData()',
'const route = useRoute()',
// $frontmatter contain runtime added data, will be deleted (for example, $frontmatter.partiallyEncryptedContents)
`const $frontmatter = Object.assign(route.meta.frontmatter || {}, pageData.value.frontmatter || {})
`const $frontmatter = Object.assign(route.meta.frontmatter || {}, pageData.value?.frontmatter || {})
route.meta.frontmatter = $frontmatter
provide('pageData', pageData.value)
Expand Down

0 comments on commit 72ac100

Please sign in to comment.