27 lines
1006 B
JavaScript
Vendored
27 lines
1006 B
JavaScript
Vendored
const VueRouter = require('vue-router');
|
|
|
|
import Home from './views/AdminHome.vue';
|
|
import Blog from "./views/Blog.vue";
|
|
import BlogArticle from "./views/BlogArticle.vue";
|
|
import BlogArticleEdit from "./views/BlogArticleEdit.vue";
|
|
|
|
import NotFound from './views/NotFound.vue';
|
|
|
|
// TODO: Change base url to be `/admin`
|
|
const routes = [
|
|
{ path: '/admin/', name: 'index', component: Home },
|
|
{ path: '/admin/blog', name: 'blog', component: Blog },
|
|
{ path: '/admin/blog/:id', name: 'blog-article', component: BlogArticle, props: route => ({ id: route.params.id, admin: true }) },
|
|
{ path: '/admin/blog/:id/edit', name: 'blog-article-edit', component: BlogArticleEdit, props: true },
|
|
{ path: '/admin/blog/create', name: 'blog-article-create', component: BlogArticleEdit },
|
|
{ path: '/:pathMatch(.*)*', name: 'NotFound', component: NotFound },
|
|
];
|
|
|
|
const router = VueRouter.createRouter({
|
|
history: VueRouter.createWebHistory(),
|
|
base: '/admin/',
|
|
routes,
|
|
});
|
|
|
|
export default router
|