30 lines
808 B
TypeScript
30 lines
808 B
TypeScript
/// <reference path="../../adonisrc.ts" />
|
|
/// <reference path="../../config/inertia.ts" />
|
|
|
|
import '../css/app.css'
|
|
import { createSSRApp, h } from 'vue'
|
|
import type { DefineComponent } from 'vue'
|
|
import { createInertiaApp, Link } from '@inertiajs/vue3'
|
|
import { resolvePageComponent } from '@adonisjs/inertia/helpers'
|
|
const appName = import.meta.env.VITE_APP_NAME || 'AdonisJS'
|
|
Vue.component('inertia-link', Link)
|
|
|
|
createInertiaApp({
|
|
progress: { color: '#5468FF' },
|
|
|
|
title: (title) => `${title} - ${appName}`,
|
|
|
|
resolve: (name) => {
|
|
return resolvePageComponent(
|
|
`../pages/${name}.vue`,
|
|
import.meta.glob<DefineComponent>('../pages/**/*.vue')
|
|
)
|
|
},
|
|
|
|
setup({ el, App, props, plugin }) {
|
|
createSSRApp({ render: () => h(App, props) })
|
|
.use(plugin)
|
|
.mount(el)
|
|
},
|
|
})
|