File tree Expand file tree Collapse file tree 3 files changed +43
-14
lines changed
Expand file tree Collapse file tree 3 files changed +43
-14
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ export default defineAppConfig({
1717 siteName : 'Nuxt UI Pro - Docs template'
1818 } ,
1919 header : {
20+ title : '' ,
21+ to : '/' ,
2022 logo : {
2123 alt : '' ,
2224 light : '' ,
Original file line number Diff line number Diff line change @@ -7,7 +7,10 @@ const { header } = useAppConfig()
77 </script >
88
99<template >
10- <UHeader :ui =" { center: 'flex-1' }" >
10+ <UHeader
11+ :ui =" { center: 'flex-1' }"
12+ :to =" header?.to || '/'"
13+ >
1114 <UContentSearchButton
1215 v-if =" header?.search"
1316 label =" Search..."
@@ -22,19 +25,29 @@ const { header } = useAppConfig()
2225 </template >
2326 </UContentSearchButton >
2427
25- <template #left >
26- <NuxtLink to =" /" >
27- <UColorModeImage
28- v-if =" header?.logo?.dark || header?.logo?.light"
29- :light =" header?.logo?.light!"
30- :dark =" header?.logo?.dark!"
31- :alt =" header?.logo?.alt"
32- class =" h-6 w-auto shrink-0"
33- />
34- <LogoPro
35- v-else
36- class =" w-auto h-6 shrink-0"
37- />
28+ <template
29+ v-if =" header ?.logo ?.dark || header ?.logo ?.light || header ?.title "
30+ #title
31+ >
32+ <UColorModeImage
33+ v-if =" header?.logo?.dark || header?.logo?.light"
34+ :light =" header?.logo?.light!"
35+ :dark =" header?.logo?.dark!"
36+ :alt =" header?.logo?.alt"
37+ class =" h-6 w-auto shrink-0"
38+ />
39+
40+ <span v-else-if =" header?.title" >
41+ {{ header.title }}
42+ </span >
43+ </template >
44+
45+ <template
46+ v-else
47+ #left
48+ >
49+ <NuxtLink :to =" header?.to || '/'" >
50+ <LogoPro class =" w-auto h-6 shrink-0" />
3851 </NuxtLink >
3952
4053 <TemplateMenu />
Original file line number Diff line number Diff line change @@ -93,6 +93,20 @@ export default defineNuxtSchema({
9393 description : 'Header configuration.' ,
9494 icon : 'i-mdi-page-layout-header' ,
9595 fields : {
96+ title : field ( {
97+ type : 'string' ,
98+ title : 'Title' ,
99+ description : 'Title to display in the header.' ,
100+ icon : 'i-mdi-format-title' ,
101+ default : ''
102+ } ) ,
103+ to : field ( {
104+ type : 'string' ,
105+ title : 'To' ,
106+ description : 'URL to redirect to when the title is clicked.' ,
107+ icon : 'i-mdi-link-variant' ,
108+ default : ''
109+ } ) ,
96110 logo : group ( {
97111 title : 'Logo' ,
98112 description : 'Header logo configuration.' ,
You can’t perform that action at this time.
0 commit comments