Skip to content

Commit f77eb4d

Browse files
author
Shaun Pelling
committed
added lesson 41 code
1 parent c4adbaa commit f77eb4d

File tree

2 files changed

+42
-2
lines changed

2 files changed

+42
-2
lines changed

src/App.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<template>
22
<div>
3+
<app-header></app-header>
34
<router-view></router-view>
45
</div>
56
</template>
@@ -8,11 +9,11 @@
89
// Imports
910
import showBlogs from './components/showBlogs.vue';
1011
import listBlogs from './components/listBlogs.vue';
12+
import header from './components/header.vue';
1113
1214
export default {
1315
components: {
14-
'show-blogs': showBlogs,
15-
'list-blogs': listBlogs
16+
'app-header': header
1617
},
1718
data () {
1819
return {

src/components/header.vue

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<template>
2+
<nav>
3+
<ul>
4+
<li><router-link to="/" exact>Blog</router-link></li>
5+
<li><router-link to="/add" exact>Add a new blog</router-link></li>
6+
</ul>
7+
</nav>
8+
</template>
9+
10+
<script>
11+
export default {}
12+
</script>
13+
14+
<style scoped>
15+
ul{
16+
list-style-type: none;
17+
text-align: center;
18+
margin: 0;
19+
}
20+
li{
21+
display: inline-block;
22+
margin: 0 10px;
23+
}
24+
a{
25+
color: #fff;
26+
text-decoration: none;
27+
padding: 6px 8px;
28+
border-radius: 10px;
29+
}
30+
nav{
31+
background: #444;
32+
padding: 14px 0;
33+
margin-bottom: 40px;
34+
}
35+
.router-link-active{
36+
background: #eee;
37+
color: #444;
38+
}
39+
</style>

0 commit comments

Comments
 (0)