Skip to content

Commit

Permalink
fix(docs): improve SSG generated docs
Browse files Browse the repository at this point in the history
  • Loading branch information
m0ksem committed Mar 7, 2024
1 parent 5682640 commit 9357440
Show file tree
Hide file tree
Showing 3 changed files with 39 additions and 38 deletions.
File renamed without changes.
71 changes: 36 additions & 35 deletions packages/docs/layouts/default.vue
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
<template>
<div
:key="isMounted + ''"
class="docs-layout"
>
<Suspense>
<div
v-if="!isMounted"
class="docs-layout__loader"
/>
<VaLayout
:top="{ fixed: true, order: 2 }"
:left="{ fixed: true, absolute: breakpoints.smDown, overlay: breakpoints.smDown && isSidebarVisible, order: 1 }"
@left-overlay-click="isSidebarVisible = false"
class="docs-layout"
>
<template #top>
<LayoutHeader
v-model:isSidebarVisible="isSidebarVisible"
v-model:isOptionsVisible="isOptionsVisible"
/>
</template>

<template #left>
<LayoutSidebar
v-model:visible="isSidebarVisible"
:mobile="breakpoints.xs"
/>
</template>

<template #content>
<main class="docs-layout__main-content">
<article class="docs-layout__page-content">
<NuxtPage />
</article>
</main>
</template>
</VaLayout>
</div>
<div
v-if="false"
class="docs-layout__loader"
/>
<VaLayout
:top="{ fixed: true, order: 2 }"
:left="{ fixed: true, absolute: breakpoints.smDown, overlay: breakpoints.smDown && isSidebarVisible, order: 1 }"
@left-overlay-click="isSidebarVisible = false"
>
<template #top>
<LayoutHeader
v-model:isSidebarVisible="isSidebarVisible"
v-model:isOptionsVisible="isOptionsVisible"
/>
</template>

<template #left>
<LayoutSidebar
v-model:visible="isSidebarVisible"
:mobile="breakpoints.xs"
/>
</template>

<template #content>
<main class="docs-layout__main-content">
<article class="docs-layout__page-content">
<NuxtPage />
</article>
</main>
</template>
</VaLayout>
</div>
</Suspense>
</template>

<script setup lang="ts">
Expand Down Expand Up @@ -74,7 +75,7 @@ useHead({
],
})
const isMounted = useIsMounted()
// const isMounted = useIsMounted()
</script>

<style lang="scss">
Expand Down
6 changes: 3 additions & 3 deletions packages/ui/src/services/config-transport/createSlots.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ComponentInternalInstance, Ref, VNode, computed } from 'vue'
import { injectChildPropsFromParent } from '../../composables/useChildComponents'
import { Props } from './shared'
import { makeVNode } from './createRenderFn'
import { makeVNode, renderSlotNode } from './createRenderFn'

const SLOT_PREFIX = 'slot:'

Expand Down Expand Up @@ -40,7 +40,7 @@ export const createSlots = (instance: ComponentInternalInstance, propsFromConfig
const childSlot = childPropsFromParent?.value?.[prefixedKey]

if (childSlot !== undefined) {
return makeVNode(childSlot)
return renderSlotNode(makeVNode(childSlot))
}

const originalSlot = target[key]
Expand All @@ -53,7 +53,7 @@ export const createSlots = (instance: ComponentInternalInstance, propsFromConfig

// Return prop from config only if user didn't pass props manually
if (propFromConfig !== undefined) {
return makeVNode(propFromConfig)
return renderSlotNode(makeVNode(propFromConfig))
}

return originalSlot
Expand Down

0 comments on commit 9357440

Please sign in to comment.