File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<div id =" app" >
3
- <div class =" navigation" :style =" `background-color: ${currentFrameworkColor}`" >
3
+ <div class =" navigation" :style =" `background-color: ${currentFrameworkColor() }`" >
4
4
<a v-for =" framework in frameworks"
5
5
:key =" framework.name"
6
6
class =" navigation__item"
@@ -39,15 +39,16 @@ export default {
39
39
]
40
40
}
41
41
},
42
- computed: {
43
- currentFrameworkColor () {
44
- let framework = this .frameworks .find (framework => window .location .pathname .toLowerCase ().includes (framework .path ));
45
- return framework .color
46
- }
47
- },
48
42
methods: {
49
43
isActive (frameworkPath ) {
50
44
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
51
52
}
52
53
}
53
54
}
You can’t perform that action at this time.
0 commit comments