mirror of
https://github.com/yawaflua/LuckyDiamond.git
synced 2025-12-10 04:09:29 +02:00
added logic for dynamic changed nav color in header component
This commit is contained in:
@@ -6,8 +6,8 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="header__nav">
|
<div class="header__nav">
|
||||||
<nav>
|
<nav>
|
||||||
<a href="#" @click="$router.push({ name: 'home' })" class="header__nav--now">Главная</a>
|
<a href="#" @click="$router.push({ name: 'home' })" :class="{ 'header__nav--now' : route === 'home' }">Главная</a>
|
||||||
<a href="#" @click="$router.push({ name: 'profile' })">Профиль</a>
|
<a href="#" @click="$router.push({ name: 'profile' })" :class="{ 'header__nav--now' : route === 'profile' }">Профиль</a>
|
||||||
<a href="#">Помощь</a>
|
<a href="#">Помощь</a>
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
@@ -47,8 +47,12 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
balance: 25000,
|
balance: 25000,
|
||||||
auth: false
|
auth: false,
|
||||||
|
route: ''
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.route = this.$route.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user