Skip to content
This repository was archived by the owner on Dec 5, 2025. It is now read-only.

Commit c728dbb

Browse files
committed
fix
1 parent 258e57b commit c728dbb

File tree

5 files changed

+21
-7
lines changed

5 files changed

+21
-7
lines changed

packages/fastify-dx-vue/virtual/create.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff 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

1212
export 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()

packages/fastify-dx-vue/virtual/layout.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
import { defineAsyncComponent, inject } from 'vue'
99
import { 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
1414
appLayouts['/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
}

packages/fastify-dx-vue/virtual/root.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
<script>
2+
export function configure (app) {
3+
// Extend Vue application instance here
4+
}
5+
</script>
6+
17
<script setup>
28
import Layout from '/dx:layout.vue'
39
</script>

starters/vue/client/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import routes from '/dx:routes.js'
22
import create from '/dx:create.js'
33

44
export default {
5-
context: await import('/dx:context.js'),
5+
context: import('/dx:context.js'),
66
routes,
77
create,
88
}

starters/vue/client/root.vue

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<script>
22
import 'uno.css'
3+
4+
export function configure (app) {
5+
// Extend Vue application instance here
6+
}
37
</script>
48

59
<script setup>

0 commit comments

Comments
 (0)