diff --git a/src/client/app/components/ClientOnly.ts b/src/client/app/components/ClientOnly.ts index 680094ce..5d54d4ea 100644 --- a/src/client/app/components/ClientOnly.ts +++ b/src/client/app/components/ClientOnly.ts @@ -1,7 +1,18 @@ import { defineComponent, onMounted, ref } from 'vue' export const ClientOnly = defineComponent({ - setup(_, { slots }) { + props: { + isClientOnly: { + type: Boolean, + default: true + } + }, + setup({ isClientOnly }, { slots }) { + if (isClientOnly) console.log({ isClientOnly, slots }) + // Programmatically determine if this component should be + // client-only based on the presence of the isClientOnly attribute. + if (!isClientOnly) return () => slots.default?.() || null + const show = ref(false) onMounted(() => { diff --git a/src/client/theme-default/components/VPNavBarMenu.vue b/src/client/theme-default/components/VPNavBarMenu.vue index 3f8fd8ae..7c7fed86 100644 --- a/src/client/theme-default/components/VPNavBarMenu.vue +++ b/src/client/theme-default/components/VPNavBarMenu.vue @@ -2,29 +2,32 @@ import { useData } from '../composables/data' import VPNavBarMenuLink from './VPNavBarMenuLink.vue' import VPNavBarMenuGroup from './VPNavBarMenuGroup.vue' +import { isClientOnly } from '../../shared' const { theme } = useData()