reworked the sub-navigation on the Match-page

This commit is contained in:
cnachtigall1991
2021-10-15 11:11:38 +02:00
parent a29f4b1f2a
commit 3e9d8c47e3
11 changed files with 244 additions and 332 deletions

View File

@@ -1,32 +1,68 @@
import {createRouter, createWebHistory} from 'vue-router'
function lazyLoad(view) {
function lazyLoadView(view) {
return () => import(`@/views/${view}.vue`)
}
function lazyLoadComponent(view) {
return () => import(`@/components/${view}.vue`)
}
const routes = [
{
path: '/',
name: 'Home',
component: lazyLoad('Home')
component: lazyLoadView('Home')
},
{
path: '/player/:id',
name: 'Player',
component: lazyLoad('Player'),
component: lazyLoadView('Player'),
props: true
},
{
path: '/match/:match_id',
name: 'Match',
component: lazyLoad('Match'),
component: lazyLoadView('Match'),
props: true,
alias: ['/match/:match_id/flashes', '/match/:match_id/utility', '/match/:match_id/damage', '/match/:match_id/details']
children: [
{
path: '',
alias: '/match/:match_id',
components: {
score: lazyLoadComponent('ScoreTeam')
}
},
{
path: 'details',
components: {
score: lazyLoadComponent('MultiKillsChart')
}
},
{
path: 'flashes',
components: {
score: lazyLoadComponent('FlashChart')
}
},
{
path: 'utility',
components: {
score: lazyLoadComponent('UtilityChart')
}
},
{
path: 'damage',
components: {
score: lazyLoadComponent('DamageChart')
}
}
]
},
{
path: '/explore',
name: 'Explore',
component: lazyLoad('Explore'),
component: lazyLoadView('Explore'),
props: true
},
{