doc.yeswiki.pro/node_modules/vitepress/dist/client/app/components/ClientOnly.js

11 lines
314 B
JavaScript
Raw Normal View History

2023-05-20 16:37:42 +00:00
import { defineComponent, ref, onMounted } from 'vue';
export const ClientOnly = defineComponent({
setup(_, { slots }) {
const show = ref(false);
onMounted(() => {
show.value = true;
});
return () => (show.value && slots.default ? slots.default() : null);
}
});