Commit 41d13a0 1 parent f1423c7 commit 41d13a0 Copy full SHA for 41d13a0
File tree 6 files changed +533
-43
lines changed
6 files changed +533
-43
lines changed Original file line number Diff line number Diff line change 9
9
10
10
<style >
11
11
@import " tailwindcss" ;
12
- @import " @nuxt/ui" ;
12
+ @import " @nuxt/ui-pro" ;
13
+
14
+ @source "./content/**/*";
13
15
</style >
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
const { data } = await useAsyncData (' contents-list' , () => queryCollectionNavigation (' content' ))
3
3
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 ,
11
9
to: child .path ,
12
10
})) ?? []),
13
- ] ))
11
+ } ))
14
12
})
15
13
</script >
16
14
@@ -19,7 +17,7 @@ const links = computed(() => {
19
17
<UNavigationMenu
20
18
class =" w-[200px] flex-none p-2 sticky top-0 h-screen"
21
19
orientation =" vertical"
22
- :items =" [ links] "
20
+ :items =" links"
23
21
/>
24
22
<div class =" flex-1 p-4 prose prose-invert" >
25
23
<slot />
Original file line number Diff line number Diff line change 1
1
<script setup lang="ts">
2
2
const { data } = await useAsyncData (' nuxt-contents-list' , () => queryCollectionNavigation (' nuxt' ))
3
3
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 ,
12
9
to: child .path ,
13
10
})) ?? []),
14
- ] ))
11
+ } ))
15
12
})
16
13
</script >
17
14
18
15
<template >
19
16
<div class =" flex" >
20
17
<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 "
22
19
orientation =" vertical"
23
20
:items =" links"
24
21
/>
Original file line number Diff line number Diff line change 1
1
export default defineNuxtConfig ( {
2
2
modules : [
3
- '../src/module' ,
4
3
'@nuxt/ui-pro' ,
4
+ '@nuxt/content' ,
5
5
'@nuxthub/core' ,
6
6
] ,
7
7
content : {
Original file line number Diff line number Diff line change 9
9
"dev:prepare" : " nuxt prepare"
10
10
},
11
11
"dependencies" : {
12
+ "@nuxt/content" : " latest" ,
12
13
"@nuxt/ui-pro" : " 3.0.0-alpha.9" ,
13
14
"@nuxthub/core" : " ^0.8.6" ,
14
15
"nuxt" : " ^3.14.159"
You can’t perform that action at this time.
0 commit comments