10 lines
314 B
JavaScript
10 lines
314 B
JavaScript
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);
|
|
}
|
|
});
|