first-commit
Some checks failed
CI Pipeline / build (push) Failing after 3m23s

This commit is contained in:
2025-08-27 14:05:33 +08:00
commit 9e1b8bdc9d
5159 changed files with 1081326 additions and 0 deletions

View File

@@ -0,0 +1,10 @@
import { defineComponent, onMounted, ref } from 'vue';
export const ClientOnly = defineComponent({
setup(_, { slots }) {
const show = ref(false);
onMounted(() => {
show.value = true;
});
return () => (show.value && slots.default ? slots.default() : null);
}
});

View File

@@ -0,0 +1,24 @@
import { useData, useRoute } from 'vitepress';
import { defineComponent, h, watch } from 'vue';
import { contentUpdatedCallbacks } from '../utils';
const runCbs = () => contentUpdatedCallbacks.forEach((fn) => fn());
export const Content = defineComponent({
name: 'VitePressContent',
props: {
as: { type: [Object, String], default: 'div' }
},
setup(props) {
const route = useRoute();
const { frontmatter, site } = useData();
watch(frontmatter, runCbs, { deep: true, flush: 'post' });
return () => h(props.as, site.value.contentProps ?? { style: { position: 'relative' } }, [
route.component
? h(route.component, {
onVnodeMounted: runCbs,
onVnodeUpdated: runCbs,
onVnodeUnmounted: runCbs
})
: '404 Page Not Found'
]);
}
});