fix: route issues

This commit is contained in:
Rogee
2024-09-21 14:48:31 +08:00
parent 63b0eb8b44
commit 2057de4859
3 changed files with 15 additions and 5 deletions

View File

@@ -1,5 +1,6 @@
import { createRouter, createWebHistory } from 'vue-router'
import NotFound from '@/views/NotFound.vue'
const router = createRouter({
history: createWebHistory(import.meta.env.BASE_URL),
@@ -10,21 +11,26 @@ const router = createRouter({
component: () => import('@/views/Home.vue'),
},
{
path: '/favorites/:offset(\d+)?',
path: '/favorites/:offset?',
name: 'favorite-messages',
component: () => import('@/views/FavoriteMessages.vue'),
},
{
path: '/channels/:channel/messages/:offset(\d+)?',
path: '/channels/:channel/messages/:offset?',
name: 'channel-messages',
component: () => import('@/views/ChannelMessages.vue'),
},
{
path: '/:pathMatch(.*)*',
name: 'NotFound',
component: import('@/views/NotFound.vue'),
component: NotFound,
},
]
})
// router.beforeEach((to, from, next) => {
// console.log(to)
// next()
// })
export default router