import { createApp } from 'vue' import { createPinia } from 'pinia' import { createWebHistory, createRouter } from 'vue-router' import './assets/main.scss' import App from './App.vue' import Main from './components/Main/index.vue' import Gallery from './components/Gallery/index.vue' import Promo from './components/Promo/index.vue' const routes = [ { path: '/', component: Main, name: 'home_no' }, { path: '/:item', component: Main, name: 'main' }, { path: '/:item/gallery', component: Gallery, name: 'gallery' }, { path: '/:item/:target', component: Promo, name: 'scene' }, ] const router = createRouter({ history: createWebHistory(), routes, }) router.beforeEach((to, from, next) => { console.log('Navigating from', from.fullPath, 'to', to.fullPath); next(); }); const pinia = createPinia() const app = createApp(App) app.use(router) app.use(pinia) app.mount('#app')