Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit b35401e

Browse files
changes
1 parent 60dcc69 commit b35401e

File tree

6 files changed

+60
-13
lines changed

6 files changed

+60
-13
lines changed

‎src/App.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<router-link :to="{name:'about'}" class="link is-info">About</router-link>
1010
</p>
1111
<p class="level-item has-text-centered">
12-
<aclass="link is-info">Contact</a>
12+
<router-link:to="{name:'contact'}"class="link is-info">Contact</router-link>
1313
</p>
1414
<p v-show="!$auth.check()" class="level-item has-text-centered">
1515
<router-link :to="{name:'login'}" class="link is-info">Login</router-link>

‎src/components/About.vue‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<template>
22
<section class="hero">
33
<div class="hero-body">
4-
<div>About</div>
4+
<div>This is a mini blog for learning more about Vue-Router, Vue-Auth using JWT and backend in a simple microservice. </div>
55
</div>
66
</section>
77
</template>

‎src/components/Contact.vue‎

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
<template>
2+
<section class="hero">
3+
<div class="hero-body">
4+
<div class="box">
5+
<article class="media">
6+
<div class="media-left">
7+
<figure class="image is-64x64">
8+
<img src="https://bulma.io/images/placeholders/128x128.png" alt="Image">
9+
</figure>
10+
</div>
11+
<div class="media-content">
12+
<div class="content">
13+
<p>
14+
<strong>Dalton</strong> <small>@daltondiaz</small>
15+
<br>
16+
Here you can put a resume about you.
17+
</p>
18+
</div>
19+
<nav class="level is-mobile">
20+
<div class="level-left">
21+
<a class="level-item">
22+
<span class="icon is-small"><i class="fas fa-reply"></i></span>
23+
</a>
24+
<a class="level-item">
25+
<span class="icon is-small"><i class="fas fa-retweet"></i></span>
26+
</a>
27+
<a class="level-item">
28+
<span class="icon is-small"><i class="fas fa-heart"></i></span>
29+
</a>
30+
</div>
31+
</nav>
32+
</div>
33+
</article>
34+
</div>
35+
</div>
36+
</section>
37+
38+
</template>
39+
<script>
40+
export default {
41+
42+
}
43+
</script>

‎src/components/Post.vue‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@
5050
<p>{{ post.description }}</p>
5151
</div>
5252
<b-field grouped group-multiline>
53-
<div v-for="(value, key, index) in post.tags">
53+
<div v-for="value in post.tags">
5454
<span class="multiselect__tag">
5555
<a class="link-tag" @click="findAllByTag(value)">
5656
<span>{{value.name}}</span>
@@ -60,7 +60,7 @@
6060
</b-field>
6161
<footer >
6262
<i class="is-small content">
63-
<div v-if="post.updateDateFormat == '' ">
63+
<div v-if="post.updateDateFormat == '' || post.updateDateFormat == null">
6464
Posted at <time>{{post.creationDateFormat}}</time>
6565
</div>
6666
<div v-else>
@@ -77,7 +77,7 @@
7777
</span>
7878
</a>
7979
<b-modal :active.sync="isComponentModalActive" has-modal-card>
80-
<v-update-post v-bind="post"></v-update-post>
80+
<v-update-post :post="post"></v-update-post>
8181
</b-modal>
8282
<a class="button is-danger" @click="deletePost(post)">
8383
<span>Delete</span>

‎src/components/UpdatePost.vue‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,12 @@
55
<p class="modal-card-title">Edit Post</p>
66
</header>
77
<section class="modal-card-body">
8+
{{ post.id }}
89
<b-field label="Title">
9-
<input type="text" class="input" placeholder="Title" v-model="title"></input>
10+
<input type="text" class="input" placeholder="Title" v-model="post.title"></input>
1011
</b-field>
1112
<b-field label="Content">
12-
<textarea class= "textarea" name="name" v-model="description" rows="8" cols="80" placeholder="Post content"></textarea>
13+
<textarea class= "textarea" name="name" v-model="post.description" rows="8" cols="80" placeholder="Post content"></textarea>
1314
</b-field>
1415
</section>
1516
<footer class="modal-card-foot">
@@ -22,20 +23,19 @@
2223
<script>
2324
2425
export default {
25-
props:['title','description','id'],
26+
props:['post'],
2627
methods:{
2728
updatePost: function(){
28-
const updatedPost = new Object();
29-
updatedPost.description = this.description;
30-
updatedPost.title = this.title;
31-
updatedPost.id = this.id;
29+
let updatedPost = new Object();
30+
updatedPost = this.post;
3231
this.$http.put(
3332
'api/v1/post', updatedPost
3433
).then(function (response) {
3534
console.log(response);
3635
}).catch(function(error){
3736
console.log(error);
38-
})
37+
});
38+
console.log("Update");
3939
}
4040
}
4141
}

‎src/main.js‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,10 @@ export var router = new VueRouter({
3535
path: '/about',
3636
name: 'about',
3737
component: require('./components/About.vue')
38+
},{
39+
path: '/contact',
40+
name: 'contact',
41+
component: require('./components/Contact.vue')
3842
},{
3943
path: '/account',
4044
name: 'account',

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /