added router-links for scoreboard-nav
This commit is contained in:
@@ -26,7 +26,8 @@ const routes = [
|
|||||||
path: '/match/:match_id',
|
path: '/match/:match_id',
|
||||||
name: 'Match',
|
name: 'Match',
|
||||||
component: lazyLoad('Match'),
|
component: lazyLoad('Match'),
|
||||||
props: true
|
props: true,
|
||||||
|
alias: ['/match/:match_id/flashes', '/match/:match_id/utility']
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
path: '/explore',
|
path: '/explore',
|
||||||
|
@@ -38,7 +38,6 @@
|
|||||||
<li class="list-item scoreboard active" @click.prevent="ActivateScoreInfo('scoreboard')">Scoreboard</li>
|
<li class="list-item scoreboard active" @click.prevent="ActivateScoreInfo('scoreboard')">Scoreboard</li>
|
||||||
<li class="list-item flashes" @click.prevent="ActivateScoreInfo('flashes')">Flashes</li>
|
<li class="list-item flashes" @click.prevent="ActivateScoreInfo('flashes')">Flashes</li>
|
||||||
<li class="list-item utility" @click.prevent="ActivateScoreInfo('utility')">Utility</li>
|
<li class="list-item utility" @click.prevent="ActivateScoreInfo('utility')">Utility</li>
|
||||||
<li class="list-item damage" @click.prevent="ActivateScoreInfo('damage')">Damage</li>
|
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -82,9 +81,10 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {defineAsyncComponent, onBeforeMount, reactive, watch} from "vue";
|
import {defineAsyncComponent, onBeforeMount, onMounted, reactive, watch} from "vue";
|
||||||
import axios from 'axios'
|
import axios from 'axios'
|
||||||
import {DisplayRank, FormatFullDate, GetHLTV_1, GoToPlayer, LoadImage} from "../utils";
|
import {DisplayRank, FormatFullDate, GetHLTV_1, GoToPlayer, LoadImage} from "../utils";
|
||||||
|
import router from "../router";
|
||||||
|
|
||||||
const ScoreTeam = defineAsyncComponent(() => import('../components/ScoreTeam'))
|
const ScoreTeam = defineAsyncComponent(() => import('../components/ScoreTeam'))
|
||||||
const FlashChart = defineAsyncComponent(() => import('../components/FlashChart'))
|
const FlashChart = defineAsyncComponent(() => import('../components/FlashChart'))
|
||||||
@@ -155,6 +155,12 @@ export default {
|
|||||||
|
|
||||||
newNavItem.classList.add('active')
|
newNavItem.classList.add('active')
|
||||||
newItem.classList.add('active')
|
newItem.classList.add('active')
|
||||||
|
|
||||||
|
if (id === 'flashes' || id === 'utility'){
|
||||||
|
history.pushState({}, null, `/match/${data.matchDetails.match_id}/${id}`)
|
||||||
|
} else if (id === 'scoreboard') {
|
||||||
|
history.pushState({}, null, `/match/${data.matchDetails.match_id}`)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Watchers
|
// Watchers
|
||||||
@@ -166,6 +172,14 @@ export default {
|
|||||||
GetMatch()
|
GetMatch()
|
||||||
})
|
})
|
||||||
|
|
||||||
|
onMounted(() => {
|
||||||
|
if (router.currentRoute.value.href.split('/')[3]) {
|
||||||
|
setTimeout(() => {
|
||||||
|
ActivateScoreInfo(router.currentRoute.value.href.split('/')[3])
|
||||||
|
}, 500)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
GetMatch, GetAvgRank, ActivateScoreInfo, data, GoToPlayer, GetHLTV_1, DisplayRank, FormatFullDate, LoadImage
|
GetMatch, GetAvgRank, ActivateScoreInfo, data, GoToPlayer, GetHLTV_1, DisplayRank, FormatFullDate, LoadImage
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user