38 lines
1.1 KiB
JavaScript
38 lines
1.1 KiB
JavaScript
import '../css/main.css'
|
|
|
|
import { createPinia } from 'pinia'
|
|
// import { useDarkModeStore } from '@/stores/darkMode.js'
|
|
import { createApp, h } from 'vue'
|
|
import { createInertiaApp } from '@inertiajs/vue3'
|
|
import { resolvePageComponent } from 'laravel-vite-plugin/inertia-helpers'
|
|
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m'
|
|
|
|
const appName = window.document.getElementsByTagName('title')[0]?.innerText || 'Laravel'
|
|
|
|
const pinia = createPinia()
|
|
|
|
createInertiaApp({
|
|
title: (title) => `${title} - ${appName}`,
|
|
resolve: (name) =>
|
|
resolvePageComponent(`./Pages/${name}.vue`, import.meta.glob('./Pages/**/*.vue')),
|
|
setup({ el, App, props, plugin }) {
|
|
return createApp({ render: () => h(App, props) })
|
|
.use(plugin)
|
|
.use(pinia)
|
|
.use(ZiggyVue, Ziggy)
|
|
.mount(el)
|
|
},
|
|
progress: {
|
|
color: '#4B5563'
|
|
}
|
|
})
|
|
|
|
// const darkModeStore = useDarkModeStore(pinia)
|
|
|
|
// if (
|
|
// (!localStorage['darkMode'] && window.matchMedia('(prefers-color-scheme: dark)').matches) ||
|
|
// localStorage['darkMode'] === '1'
|
|
// ) {
|
|
// darkModeStore.set(true)
|
|
// }
|