File tree Expand file tree Collapse file tree 6 files changed +533
-43
lines changed Expand file tree Collapse file tree 6 files changed +533
-43
lines changed Original file line number Diff line number Diff line change 99
1010<style >
1111@import " tailwindcss" ;
12- @import " @nuxt/ui" ;
12+ @import " @nuxt/ui-pro" ;
13+
14+ @source "./content/**/*";
1315 </style >
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22const { data } = await useAsyncData (' contents-list' , () => queryCollectionNavigation (' content' ))
33const 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 />
Original file line number Diff line number Diff line change 11<script setup lang="ts">
22const { data } = await useAsyncData (' nuxt-contents-list' , () => queryCollectionNavigation (' nuxt' ))
33const 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 />
Original file line number Diff line number Diff line change 11export default defineNuxtConfig ( {
22 modules : [
3- '../src/module' ,
43 '@nuxt/ui-pro' ,
4+ '@nuxt/content' ,
55 '@nuxthub/core' ,
66 ] ,
77 content : {
Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments