38 lines
1013 B
TypeScript
38 lines
1013 B
TypeScript
import '../css/app.css';
|
|
|
|
import { createInertiaApp } from '@inertiajs/vue3';
|
|
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers';
|
|
import { createApp, h } from 'vue';
|
|
import type {DefineComponent} from 'vue';
|
|
import MainLayout from '@/layouts/MainLayout.vue';
|
|
import vuetify from '@/plugins/vuetify';
|
|
|
|
const appName = import.meta.env.VITE_APP_NAME || 'Laravel';
|
|
|
|
createInertiaApp({
|
|
title: (title) => (title ? `${title} - ${appName}` : appName),
|
|
|
|
resolve: (name) => {
|
|
const page = resolvePageComponent(
|
|
`./pages/${name}.vue`,
|
|
import.meta.glob<DefineComponent>('./pages/**/*.vue'),
|
|
);
|
|
page.then((module) => {
|
|
module.default.layout ??= MainLayout;
|
|
});
|
|
|
|
return page;
|
|
},
|
|
|
|
setup({ el, App, props, plugin }) {
|
|
return createApp({ render: () => h(App, props) })
|
|
.use(plugin)
|
|
.use(vuetify)
|
|
.mount(el);
|
|
},
|
|
|
|
progress: {
|
|
color: '#C0392B',
|
|
},
|
|
});
|