Skip to content

Commit

Permalink
let's just route everything except home to pageview
Browse files Browse the repository at this point in the history
  • Loading branch information
djdjz7 committed Dec 24, 2024
1 parent f3756f7 commit ca8acca
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/router/router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,7 @@ function initListeners(go: (href?: string) => Promise<void>) {
function getMainModule(href: string): Module | Promise<Module> {
const url = new URL(href, 'http://a.com/')
const path = url.pathname
if (path === '/') return import('@/views/HomeView.vue')
const segs = path.split('/')
if (segs[1] === 'activities' || segs[1] === 'news') return import('@/views/PageView.vue')
return import('@/views/NotFoundView.vue')
if (path === '/' || path === '/index' || path === '/index.html')
return import('@/views/HomeView.vue')
return import('@/views/PageView.vue')
}

0 comments on commit ca8acca

Please sign in to comment.