Skip to content

Commit d9e3025

Browse files
committed
Fix navigation colors
1 parent 1ff0db9 commit d9e3025

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/App.vue

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div id="app">
3-
<div class="navigation" :style="`background-color: ${currentFrameworkColor}`">
3+
<div class="navigation" :style="`background-color: ${currentFrameworkColor()}`">
44
<a v-for="framework in frameworks"
55
:key="framework.name"
66
class="navigation__item"
@@ -39,15 +39,16 @@ export default {
3939
]
4040
}
4141
},
42-
computed: {
43-
currentFrameworkColor () {
44-
let framework = this.frameworks.find(framework => window.location.pathname.toLowerCase().includes(framework.path));
45-
return framework.color
46-
}
47-
},
4842
methods: {
4943
isActive(frameworkPath) {
5044
return window.location.pathname.includes(frameworkPath)
45+
},
46+
currentFrameworkColor () {
47+
let framework = this.frameworks.find(framework => window.location.pathname.toLowerCase().includes(framework.path));
48+
if (!framework) {
49+
return 'black'
50+
}
51+
return framework.color
5152
}
5253
}
5354
}

0 commit comments

Comments
 (0)