This repository was archived by the owner on Dec 5, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +21
-7
lines changed
packages/fastify-dx-vue/virtual Expand file tree Collapse file tree 5 files changed +21
-7
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,14 @@ import {
77 routeLayout ,
88 createBeforeEachHandler ,
99} from '/dx:core.js'
10- import root from '/dx:root.vue'
10+ import * as root from '/dx:root.vue'
1111
1212export default async function create ( ctx ) {
1313 const { routes, ctxHydration } = ctx
1414
1515 const instance = ctxHydration . clientOnly
16- ? createApp ( root )
17- : createSSRApp ( root )
16+ ? createApp ( root . default )
17+ : createSSRApp ( root . default )
1818
1919 const history = createHistory ( )
2020 const router = createRouter ( { history, routes } )
@@ -31,6 +31,10 @@ export default async function create (ctx) {
3131
3232 instance . use ( router )
3333
34+ if ( root . configure ) {
35+ await root . configure ( instance )
36+ }
37+
3438 if ( ctx . url ) {
3539 router . push ( ctx . url )
3640 await router . isReady ( )
Original file line number Diff line number Diff line change 88import { defineAsyncComponent , inject } from ' vue'
99import { routeLayout } from ' /dx:core.js'
1010
11- const DefaultLayout = () => import ( ' /dx:layouts/default.vue' )
12- const appLayouts = import .meta.glob (' /layouts/*.vue' )
11+ import * as DefaultLayout from ' /dx:layouts/default.vue'
12+ const appLayouts = import .meta.globEager (' /layouts/*.vue' )
1313
1414appLayouts[' /layouts/default.vue' ] ?? = DefaultLayout
1515
@@ -20,7 +20,7 @@ export default {
2020 components: Object .fromEntries (
2121 Object .keys (appLayouts).map ((path ) => {
2222 const name = path .slice (9 , - 4 )
23- return [name, defineAsyncComponent ( appLayouts[path]) ]
23+ return [name, appLayouts[path]. default ]
2424 })
2525 )
2626}
Original file line number Diff line number Diff line change 1+ <script >
2+ export function configure (app ) {
3+ // Extend Vue application instance here
4+ }
5+ </script >
6+
17<script setup>
28import Layout from ' /dx:layout.vue'
39 </script >
Original file line number Diff line number Diff line change @@ -2,7 +2,7 @@ import routes from '/dx:routes.js'
22import create from '/dx:create.js'
33
44export default {
5- context : await import ( '/dx:context.js' ) ,
5+ context : import ( '/dx:context.js' ) ,
66 routes,
77 create,
88}
Original file line number Diff line number Diff line change 11<script >
22import ' uno.css'
3+
4+ export function configure (app ) {
5+ // Extend Vue application instance here
6+ }
37 </script >
48
59<script setup>
You can’t perform that action at this time.
0 commit comments