Skip to content

Commit 41d13a0

Browse files
committed
chore: update playground
1 parent f1423c7 commit 41d13a0

File tree

6 files changed

+533
-43
lines changed

6 files changed

+533
-43
lines changed

playground/app.vue

+3-1
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,7 @@
99

1010
<style>
1111
@import "tailwindcss";
12-
@import "@nuxt/ui";
12+
@import "@nuxt/ui-pro";
13+
14+
@source "./content/**/*";
1315
</style>

playground/layouts/default.vue

+7-9
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,14 @@
11
<script setup lang="ts">
22
const { data } = await useAsyncData('contents-list', () => queryCollectionNavigation('content'))
33
const links = computed(() => {
4-
return data.value?.flatMap(item => ([
5-
{
6-
label: item.title,
7-
to: item.page !== false ? item.path : undefined,
8-
},
9-
...(item.children?.map(child => ({
10-
label: ` -- ${child.title}`,
4+
return data.value?.map(item => ({
5+
label: item.title,
6+
to: item.page !== false ? item.path : undefined,
7+
children: (item.children?.map(child => ({
8+
label: child.title,
119
to: child.path,
1210
})) ?? []),
13-
]))
11+
}))
1412
})
1513
</script>
1614

@@ -19,7 +17,7 @@ const links = computed(() => {
1917
<UNavigationMenu
2018
class="w-[200px] flex-none p-2 sticky top-0 h-screen"
2119
orientation="vertical"
22-
:items="[links]"
20+
:items="links"
2321
/>
2422
<div class="flex-1 p-4 prose prose-invert">
2523
<slot />

playground/layouts/nuxt.vue

+7-10
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,21 @@
11
<script setup lang="ts">
22
const { data } = await useAsyncData('nuxt-contents-list', () => queryCollectionNavigation('nuxt'))
33
const links = computed(() => {
4-
const root = data.value?.[0].children || []
5-
return root?.flatMap(item => ([
6-
{
7-
label: item.title,
8-
to: item.page !== false ? item.path : undefined,
9-
},
10-
...(item.children?.map(child => ({
11-
label: ` -- ${child.title}`,
4+
return data.value?.[0].children?.map(item => ({
5+
label: item.title,
6+
to: item.page !== false ? item.path : undefined,
7+
children: (item.children?.map(child => ({
8+
label: child.title,
129
to: child.path,
1310
})) ?? []),
14-
]))
11+
}))
1512
})
1613
</script>
1714

1815
<template>
1916
<div class="flex">
2017
<UNavigationMenu
21-
class="w-[200px] flex-none p-2 sticky top-0 h-screen"
18+
class="w-[200px] flex-none p-2 sticky top-0 h-screen overflow-y-auto"
2219
orientation="vertical"
2320
:items="links"
2421
/>

playground/nuxt.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
export default defineNuxtConfig({
22
modules: [
3-
'../src/module',
43
'@nuxt/ui-pro',
4+
'@nuxt/content',
55
'@nuxthub/core',
66
],
77
content: {

playground/package.json

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
"dev:prepare": "nuxt prepare"
1010
},
1111
"dependencies": {
12+
"@nuxt/content": "latest",
1213
"@nuxt/ui-pro": "3.0.0-alpha.9",
1314
"@nuxthub/core": "^0.8.6",
1415
"nuxt": "^3.14.159"

0 commit comments

Comments
 (0)