refactor: 优化AppFooter.vue组件 (#413)
parent
6483bbd1a7
commit
bdff7eaefe
|
@ -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';
|
||||
|
||||
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue