File tree Expand file tree Collapse file tree 7 files changed +95
-8
lines changed Expand file tree Collapse file tree 7 files changed +95
-8
lines changed Original file line number Diff line number Diff line change 11{
22 "cSpell.words" : [
3+ " defu" ,
34 " nuxtify" ,
45 " nuxtifydev"
56 ]
Original file line number Diff line number Diff line change 3131 "dependencies" : {
3232 "@mdi/js" : " ^7.4.47" ,
3333 "@nuxt/kit" : " ^3.16.1" ,
34+ "defu" : " ^6.1.4" ,
3435 "vuetify-nuxt-module" : " ^0.18.4"
3536 },
3637 "devDependencies" : {
Original file line number Diff line number Diff line change 1+ <script setup lang="ts">
2+ const nuxtifyConfig = useAppConfig ().nuxtify
3+ </script >
4+
15<template >
26 <div >
37 nuxtify-pages module playground!
48 <v-btn >
59 Test
610 </v-btn >
711 </div >
8- </template >
912
10- <script setup lang="ts">
11- </script >
13+ <h2 >nuxtifyConfig</h2 >
14+ <pre >
15+ {{ nuxtifyConfig }}
16+ </pre >
17+ </template >
Original file line number Diff line number Diff line change @@ -2,5 +2,9 @@ export default defineNuxtConfig({
22 modules : [ '../src/module' ] ,
33 devtools : { enabled : true } ,
44 compatibilityDate : '2025-03-22' ,
5- myModule : { } ,
5+ nuxtify : {
6+ brand : {
7+ name : 'nuxtify-pages-playground' ,
8+ } ,
9+ } ,
610} )
Original file line number Diff line number Diff line change @@ -4,20 +4,33 @@ import {
44 createResolver ,
55 installModule ,
66} from '@nuxt/kit'
7+ import { defu } from 'defu'
78
8- // Module options TypeScript interface definition
9- export interface ModuleOptions { }
9+ // Types
10+ import type { ModuleOptions } from '../src/runtime/types'
1011
1112export default defineNuxtModule < ModuleOptions > ( {
1213 meta : {
1314 name : 'nuxtify-pages' ,
1415 configKey : 'nuxtify' ,
1516 compatibility : {
1617 nuxt : '>=3.16.0' ,
18+ bridge : false ,
19+ } ,
20+ } ,
21+ defaults : {
22+ brand : {
23+ name : 'nuxtify-pages' ,
24+ domain : '' ,
25+ tagline : '' ,
26+ logo : {
27+ lightUrl : '' ,
28+ darkUrl : '' ,
29+ width : 200 ,
30+ mobileWidth : 150 ,
31+ } ,
1732 } ,
1833 } ,
19- // Default configuration options of the Nuxt module
20- defaults : { } ,
2134 async setup ( _options , _nuxt ) {
2235 const resolver = createResolver ( import . meta. url )
2336
@@ -26,6 +39,11 @@ export default defineNuxtModule<ModuleOptions>({
2639 vuetifyOptions : resolver . resolve ( './runtime/vuetify.config.ts' ) ,
2740 } )
2841
42+ // Expose module options to app config
43+ _nuxt . options . appConfig . nuxtify = defu ( _nuxt . options . appConfig . nuxtify , {
44+ ..._options ,
45+ } )
46+
2947 // Do not add the extension since the `.ts` will be transpiled to `.mjs` after `npm run prepack`
3048 addPlugin ( resolver . resolve ( './runtime/plugin' ) )
3149 } ,
Original file line number Diff line number Diff line change 1+ interface BrandOptions {
2+ /**
3+ * The name of the brand.
4+ *
5+ * @default "nuxtify-pages"
6+ */
7+ name ?: string
8+ /**
9+ * The domain of the brand.
10+ *
11+ * @default ""
12+ */
13+ domain ?: string
14+ /**
15+ * The tagline of the brand.
16+ *
17+ * @default ""
18+ */
19+ tagline ?: string
20+ /**
21+ * The logo of the brand.
22+ */
23+ logo ?: {
24+ /**
25+ * The URL of the light logo. Recommended 5:1 aspect ratio (e.g. 400 x 80 px).
26+ *
27+ * @default ""
28+ */
29+ lightUrl ?: string
30+ /**
31+ * The URL of the dark logo. Recommended 5:1 aspect ratio (e.g. 400 x 80 px).
32+ *
33+ * @default ""
34+ */
35+ darkUrl ?: string
36+ /**
37+ * The width of the logo.
38+ *
39+ * @default 200
40+ */
41+ width ?: number
42+ /**
43+ * The width of the logo on mobile.
44+ *
45+ * @default 150
46+ */
47+ mobileWidth ?: number
48+ }
49+ }
50+
51+ export interface ModuleOptions {
52+ /**
53+ * Brand options
54+ */
55+ brand ?: BrandOptions
56+ }
You can’t perform that action at this time.
0 commit comments