updated frontend from typescript to javascript
This commit is contained in:
@@ -1,12 +1,43 @@
|
||||
import { createRouter, createWebHistory } from 'vue-router'
|
||||
import Home from '../views/Home.vue'
|
||||
|
||||
function lazyLoad(view) {
|
||||
return () => import(`@/views/${view}.vue`)
|
||||
}
|
||||
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: Home
|
||||
component: lazyLoad('Home')
|
||||
},
|
||||
{
|
||||
path: '/player/:id',
|
||||
name: 'Player',
|
||||
component: lazyLoad('Player'),
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: '/player/:id/matches',
|
||||
name: 'MyMatches',
|
||||
component: lazyLoad('MyMatches'),
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: '/match/:match_id',
|
||||
name: 'Match',
|
||||
component: lazyLoad('Match'),
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: '/explore',
|
||||
name: 'Explore',
|
||||
component: lazyLoad('Explore'),
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: '/:pathMatch(.*)*',
|
||||
redirect: '/'
|
||||
}
|
||||
]
|
||||
|
||||
const router = createRouter({
|
||||
|
||||
Reference in New Issue
Block a user