Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0a23b94

Browse files
authored
fix(theme): fix collection type error when the homepage is set as a posts, close #729 (#732)
1 parent 6325d09 commit 0a23b94

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

theme/src/client/components/Posts/VPPosts.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import VPPostsExtract from '@theme/Posts/VPPostsExtract.vue'
77
import VPPostsNav from '@theme/Posts/VPPostsNav.vue'
88
import VPPostsTags from '@theme/Posts/VPPostsTags.vue'
99
import VPTransitionFadeSlideY from '@theme/VPTransitionFadeSlideY.vue'
10-
import { watch } from 'vue'
10+
import { onBeforeUnmount, watch } from 'vue'
1111
import { forceUpdateCollection, useData } from '../../composables/index.js'
1212
1313
const props = defineProps<{
@@ -24,6 +24,8 @@ watch(
2424
() => forceUpdateCollection(props.homePosts ? (props.collection || true) : undefined),
2525
{ immediate: true },
2626
)
27+
28+
onBeforeUnmount(() => forceUpdateCollection(undefined))
2729
</script>
2830

2931
<template>

0 commit comments

Comments
 (0)