Files
docs/node_modules/vitepress/dist/client/app/components/ClientOnly.js
yinxue 9e1b8bdc9d
Some checks failed
CI Pipeline / build (push) Failing after 3m23s
first-commit
2025-08-27 14:05:33 +08:00

11 lines
314 B
JavaScript

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);
}
});