Files
spritesheet-generator/src/router/index.ts
2026-01-02 00:47:41 +01:00

63 lines
1.4 KiB
TypeScript

import { createRouter, createWebHistory } from 'vue-router';
import HomeView from '../views/HomeView.vue';
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
routes: [
{
path: '/',
name: 'home',
component: HomeView,
},
{
path: '/about',
name: 'about',
component: () => import('../views/AboutUs.vue'),
},
{
path: '/contact',
name: 'contact',
component: () => import('../views/Contact.vue'),
},
{
path: '/privacy-policy',
name: 'privacy-policy',
component: () => import('../views/PrivacyPolicy.vue'),
},
{
path: '/faq',
name: 'faq',
component: () => import('../views/FAQ.vue'),
},
{
path: '/blog',
name: 'blog-overview',
component: () => import('../views/BlogOverview.vue'),
},
{
path: '/blog/:slug',
name: 'blog-detail',
component: () => import('../views/BlogDetail.vue'),
},
{
path: '/share/:id',
name: 'share',
component: () => import('../views/ShareView.vue'),
},
{
path: '/editor/:id?',
name: 'editor',
component: () => import('../views/EditorView.vue'),
},
],
scrollBehavior(to, from, savedPosition) {
if (savedPosition) {
return savedPosition;
} else {
return { top: 0 };
}
},
});
export default router;