mirror of
https://git.hmsn.ink/kospo/svcm/dmz.git
synced 2026-03-20 11:53:39 +09:00
first
This commit is contained in:
18
src/components/ClientOnly.vue
Normal file
18
src/components/ClientOnly.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<script lang="ts">
|
||||
import type { SlotsType } from 'vue'
|
||||
|
||||
export default defineComponent({
|
||||
name: 'ClientOnly',
|
||||
slots: Object as SlotsType<{
|
||||
default: void
|
||||
}>,
|
||||
setup(_, { slots }) {
|
||||
const show = ref(false)
|
||||
onMounted(() => {
|
||||
show.value = true
|
||||
})
|
||||
|
||||
return () => (show.value && slots.default ? slots.default() : null)
|
||||
},
|
||||
})
|
||||
</script>
|
||||
Reference in New Issue
Block a user