Skip to content

Commit

Permalink
refactor: 优化AppFooter.vue组件 (#413)
Browse files Browse the repository at this point in the history
  • Loading branch information
Leetfs committed Sep 18, 2024
1 parent 6483bbd commit bdff7ea
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<script setup lang="ts">
import { ref, watch, onMounted } from 'vue';
import { ref, watch, } from 'vue';
import { NolebaseGitChangelog } from '@nolebase/vitepress-plugin-git-changelog/client';
import { useRoute } from 'vitepress';
Expand All @@ -21,10 +21,10 @@ const updateKeyAndFrontmatter = () => {
watch(() => route.path, () => {
isFrontmatterLoaded.value = false;
updateKeyAndFrontmatter();
});
}, { immediate: true }); // 在组件挂载时立即执行一次,确保第一次渲染时 key 和 frontmatter 是正确的
// 在组件挂载时更新 key 和 frontmatter
onMounted(updateKeyAndFrontmatter);
// onMounted(updateKeyAndFrontmatter);
</script>

<template>
Expand Down

0 comments on commit bdff7ea

Please sign in to comment.