Skip to content

Commit 8c581e0

Browse files
author
Shaun Pelling
committed
added lesson 43 code
1 parent 10edba9 commit 8c581e0

File tree

3 files changed

+10
-19
lines changed

3 files changed

+10
-19
lines changed

src/components/addBlog.vue

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -27,17 +27,6 @@
2727
<div v-if="submitted">
2828
<h3>Thanks for adding your post</h3>
2929
</div>
30-
<div id="preview">
31-
<h3>Preview blog</h3>
32-
<p>Blog title: {{ blog.title }}</p>
33-
<p>Blog content:</p>
34-
<p style="white-space: pre">{{ blog.content }}</p>
35-
<p>Blog Categories:</p>
36-
<ul>
37-
<li v-for="category in blog.categories">{{ category }}</li>
38-
</ul>
39-
<p>Author: {{ blog.author }}</p>
40-
</div>
4130
</div>
4231
</template>
4332

@@ -59,11 +48,7 @@ export default {
5948
},
6049
methods: {
6150
post: function(){
62-
this.$http.post('http://jsonplaceholder.typicode.com/posts', {
63-
title: this.blog.title,
64-
body: this.blog.content,
65-
userId: 1
66-
}).then(function(data){
51+
this.$http.post('https://nn-vue-playlist.firebaseio.com/posts.json', this.blog).then(function(data){
6752
console.log(data);
6853
this.submitted = true;
6954
});

src/components/header.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,11 @@ a{
2525
color: #fff;
2626
text-decoration: none;
2727
padding: 6px 8px;
28-
border-radius: 10px;
28+
border-radius: 5px;
2929
}
3030
nav{
3131
background: #444;
32-
padding: 14px 0;
32+
padding: 20px 0;
3333
margin-bottom: 40px;
3434
}
3535
.router-link-active{

src/components/showBlogs.vue

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export default {
2929
}
3030
</script>
3131

32-
<style>
32+
<style scoped>
3333
#show-blogs{
3434
max-width: 800px;
3535
margin: 0px auto;
@@ -45,4 +45,10 @@ export default {
4545
color: #444;
4646
text-decoration: none;
4747
}
48+
input[type="text"]{
49+
padding: 8px;
50+
width: 100%;
51+
box-sizing: border-box;
52+
}
53+
4854
</style>

0 commit comments

Comments
 (0)