Skip to content

Commit

Permalink
clear data when leaving article
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrieh committed Mar 18, 2024
1 parent 31c540a commit ce34a2f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions pages/news/[slug].vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ const { data } = await useAsyncData("page-data", () =>
queryContent<News>(`/news/${slug}`).findOne()
);
onBeforeRouteLeave(() => {
data.value = null;
});
useSeoMeta({
title: data.value?.title,
description: data.value?.description,
Expand Down

0 comments on commit ce34a2f

Please sign in to comment.