Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: 优化AppFooter.vue组件 #413

Merged
merged 3 commits into from
Sep 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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