41 lines
1.1 KiB
TypeScript
41 lines
1.1 KiB
TypeScript
import '../css/app.sass';
|
|
|
|
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';
|
|
import { ZiggyVue } from 'ziggy-js'
|
|
import '@mdi/font/css/materialdesignicons.css';
|
|
|
|
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)
|
|
.use(ZiggyVue)
|
|
.mount(el);
|
|
},
|
|
|
|
progress: {
|
|
color: '#C0392B',
|
|
},
|
|
});
|