27 lines
1.0 KiB
TypeScript
27 lines
1.0 KiB
TypeScript
import { createRouter, createWebHistory } from 'vue-router'
|
|||
|
|
|
||
|
|
const router = createRouter({
|
||
|
|
history: createWebHistory(),
|
||
|
|
routes: [
|
||
|
|
{
|
||
|
|
path: '/',
|
||
|
|
component: () => import('../layouts/DefaultLayout.vue'),
|
||
|
|
children: [
|
||
|
|
{ path: '', name: 'home', component: () => import('../views/RootPickerView.vue') },
|
||
|
|
{ path: 'recent/added', name: 'recent-added', component: () => import('../views/RecentAddedView.vue') },
|
||
|
|
{ path: 'recent/played', name: 'recent-played', component: () => import('../views/RecentPlayedView.vue') },
|
||
|
|
{ path: 'browse/:rootId', name: 'browse', component: () => import('../views/BrowseView.vue'), props: true },
|
||
|
|
{ path: 'browse/:rootId/*', name: 'browse-path', component: () => import('../views/BrowseView.vue'), props: true },
|
||
|
|
{ path: 'search', name: 'search', component: () => import('../views/SearchView.vue') },
|
||
|
|
],
|
||
|
|
},
|
||
|
|
{
|
||
|
|
path: '/admin',
|
||
|
|
name: 'admin',
|
||
|
|
component: () => import('../components/AdminPage.vue'),
|
||
|
|
},
|
||
|
|
],
|
||
|
|
})
|
||
|
|
|
||
|
|
export default router
|