mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-30 19:57:55 +01:00
docs: embed playground
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="w-full h-px bg-gray-200 dark:bg-gray-800 flex items-center justify-center">
|
<div v-if="$route.path !== '/playground'" class="w-full h-px bg-gray-200 dark:bg-gray-800 flex items-center justify-center">
|
||||||
<div class="bg-white dark:bg-gray-900 px-4">
|
<div class="bg-white dark:bg-gray-900 px-4">
|
||||||
<LogoOnly class="w-5 h-5" />
|
<LogoOnly class="w-5 h-5" />
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -12,14 +12,12 @@
|
|||||||
</NuxtLink>
|
</NuxtLink>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="$route.path !== '/'" #center>
|
|
||||||
<UDocsSearchButton class="ml-1.5 hidden lg:flex lg:w-64 xl:w-96" />
|
|
||||||
</template>
|
|
||||||
|
|
||||||
<template #right>
|
<template #right>
|
||||||
<ColorPicker />
|
<ColorPicker />
|
||||||
|
|
||||||
<UDocsSearchButton :class="[$route.path !== '/' && 'lg:hidden']" icon-only />
|
<UTooltip text="Search" :shortcuts="[metaSymbol, 'K']">
|
||||||
|
<UDocsSearchButton icon-only />
|
||||||
|
</UTooltip>
|
||||||
|
|
||||||
<UColorModeButton v-if="!$colorMode.forced" />
|
<UColorModeButton v-if="!$colorMode.forced" />
|
||||||
|
|
||||||
@@ -37,16 +35,12 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import type { NavItem } from '@nuxt/content/dist/runtime/types'
|
import type { NavItem } from '@nuxt/content/dist/runtime/types'
|
||||||
|
|
||||||
const route = useRoute()
|
const { metaSymbol } = useShortcuts()
|
||||||
const { mapContentNavigation } = useElementsHelpers()
|
const { mapContentNavigation } = useElementsHelpers()
|
||||||
|
|
||||||
const navigation = inject<Ref<NavItem[]>>('navigation')
|
const navigation = inject<Ref<NavItem[]>>('navigation')
|
||||||
|
|
||||||
const links = computed(() => {
|
const links = computed(() => {
|
||||||
if (route.path !== '/') {
|
|
||||||
return []
|
|
||||||
}
|
|
||||||
|
|
||||||
return [{
|
return [{
|
||||||
label: 'Documentation',
|
label: 'Documentation',
|
||||||
icon: 'i-heroicons-book-open-solid',
|
icon: 'i-heroicons-book-open-solid',
|
||||||
@@ -58,8 +52,7 @@ const links = computed(() => {
|
|||||||
}, {
|
}, {
|
||||||
label: 'Playground',
|
label: 'Playground',
|
||||||
icon: 'i-simple-icons-stackblitz',
|
icon: 'i-simple-icons-stackblitz',
|
||||||
to: 'https://stackblitz.com/edit/nuxt-ui?file=app.config.ts,app.vue',
|
to: '/playground'
|
||||||
target: '_blank'
|
|
||||||
}, {
|
}, {
|
||||||
label: 'Releases',
|
label: 'Releases',
|
||||||
icon: 'i-heroicons-rocket-launch-solid',
|
icon: 'i-heroicons-rocket-launch-solid',
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
<UContainer>
|
<UContainer>
|
||||||
<UPage>
|
<UPage>
|
||||||
<template #left>
|
<template #left>
|
||||||
<UAside :links="anchors">
|
<UAside>
|
||||||
<BranchSelect />
|
<BranchSelect />
|
||||||
|
|
||||||
<UNavigationTree :links="mapContentNavigation(navigation)" />
|
<UNavigationTree :links="mapContentNavigation(navigation)" />
|
||||||
@@ -22,20 +22,4 @@ import type { NavItem } from '@nuxt/content/dist/runtime/types'
|
|||||||
const { mapContentNavigation } = useElementsHelpers()
|
const { mapContentNavigation } = useElementsHelpers()
|
||||||
|
|
||||||
const navigation = inject<NavItem[]>('navigation')
|
const navigation = inject<NavItem[]>('navigation')
|
||||||
|
|
||||||
const anchors = [{
|
|
||||||
label: 'Documentation',
|
|
||||||
icon: 'i-heroicons-book-open-solid',
|
|
||||||
to: '/getting-started'
|
|
||||||
}, {
|
|
||||||
label: 'Playground',
|
|
||||||
icon: 'i-simple-icons-stackblitz',
|
|
||||||
to: 'https://stackblitz.com/edit/nuxt-ui?file=app.config.ts,app.vue',
|
|
||||||
target: '_blank'
|
|
||||||
}, {
|
|
||||||
label: 'Releases',
|
|
||||||
icon: 'i-heroicons-rocket-launch-solid',
|
|
||||||
to: 'https://github.com/nuxt/ui/releases',
|
|
||||||
target: '_blank'
|
|
||||||
}]
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
24
docs/pages/playground.vue
Normal file
24
docs/pages/playground.vue
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<script setup>
|
||||||
|
const title = 'Playground'
|
||||||
|
const description = 'Play online with our interactive Nuxt Image playground.'
|
||||||
|
|
||||||
|
useSeoMeta({
|
||||||
|
title,
|
||||||
|
ogTitle: 'Nuxt UI Playground',
|
||||||
|
description
|
||||||
|
})
|
||||||
|
|
||||||
|
defineOgImage({
|
||||||
|
component: 'Docs',
|
||||||
|
title,
|
||||||
|
description
|
||||||
|
})
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<template>
|
||||||
|
<div class="h-[calc(100vh-var(--header-height))]">
|
||||||
|
<ClientOnly>
|
||||||
|
<iframe :src="`https://stackblitz.com/edit/nuxt-ui?embed=1&file=app.config.ts,app.vue&theme=${$colorMode.preference}`" width="100%" height="100%" />
|
||||||
|
</ClientOnly>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
Reference in New Issue
Block a user