41 lines
971 B
JavaScript
41 lines
971 B
JavaScript
import { createRouter, createWebHashHistory } from 'vue-router';
|
|
|
|
// Define your routes here
|
|
const routes = [
|
|
{
|
|
path: '/',
|
|
name: 'Home',
|
|
component: () => import('./pages/HomePage.vue')
|
|
},
|
|
{
|
|
path: '/medias',
|
|
name: 'Medias',
|
|
component: () => import('./pages/MediaPage.vue')
|
|
},
|
|
{
|
|
path: '/posts',
|
|
name: 'Posts',
|
|
component: () => import('./pages/PostPage.vue'),
|
|
},
|
|
// Add route for post creation
|
|
{
|
|
path: '/posts/create',
|
|
name: 'CreatePost',
|
|
component: () => import('./pages/PostCreatePage.vue')
|
|
},
|
|
// Add route for post editing
|
|
{
|
|
path: '/posts/edit/:id',
|
|
name: 'EditPost',
|
|
component: () => import('./pages/PostEditPage.vue'),
|
|
props: true
|
|
},
|
|
];
|
|
|
|
// Create the router instance
|
|
export const router = createRouter({
|
|
// history: createWebHistory(),
|
|
history: createWebHashHistory(),
|
|
routes
|
|
});
|