-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Luhana.blog list #303
base: main
Are you sure you want to change the base?
Luhana.blog list #303
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
<template> | ||
<v-dialog max-width="600px"> | ||
<template #activator="{ on }"> | ||
<v-btn class="mx-3" fab dark small color="grey" v-on="on"> | ||
<v-icon dark> mdi-plus </v-icon> | ||
</v-btn> | ||
</template> | ||
<v-card> | ||
<v-card-title> | ||
<h2>New Blog</h2> | ||
</v-card-title> | ||
<v-card-text> | ||
<v-form class="px-3"> | ||
<v-text-field v-model="title" label="Title" /> | ||
<v-textarea v-model="desc" label="Desc" /> | ||
<v-spacer></v-spacer> | ||
<v-btn class="mx-0 mt-3" color="aqua" @click="onSubmit" | ||
>Add Blog</v-btn | ||
> | ||
</v-form> | ||
</v-card-text> | ||
</v-card> | ||
</v-dialog> | ||
</template> | ||
<script> | ||
import { mapActions } from 'vuex' | ||
export default { | ||
name: 'AddBlog', | ||
data() { | ||
return { | ||
title: '', | ||
desc: '', | ||
blogPost: {}, | ||
} | ||
}, | ||
methods: { | ||
...mapActions(['addBlog']), | ||
onSubmit(e) { | ||
e.preventDefault() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit; remove this line it is unnecessary |
||
this.blogPost = { | ||
title: this.title, | ||
desc: this.desc, | ||
description: 'description', | ||
} | ||
Comment on lines
+40
to
+44
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit; remove this line |
||
this.addBlog(this.blogPost) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this.addBlog(this.blog) |
||
this.title = '' | ||
this.desc = '' | ||
Comment on lines
+46
to
+47
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. this.clearForm() |
||
}, | ||
reset() { | ||
this.$v.$reset() | ||
this.title = '' | ||
this.desc = '' | ||
}, | ||
}, | ||
} | ||
</script> |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<template> | ||
<div class="blog-item"> | ||
<v-container class="pa-2 mb-6 mx-7 mt-3"> | ||
<AddBlog /> | ||
</v-container> | ||
<v-card color="#00FFFF" dark> | ||
<v-list-item two-line> | ||
<v-list-item-content> | ||
<v-card-title class="text-h5 mt-1"> | ||
<span class="text-h6 font-weight-bold">Classic Books</span> | ||
</v-card-title> | ||
|
||
<v-card-subtitle | ||
>'Altough most classic novels are a bit harder to read, they carry | ||
the authenticity with a time-stamp that takes you to a time you;ve | ||
never been.'</v-card-subtitle | ||
> | ||
<v-card-text>Luhana</v-card-text> | ||
</v-list-item-content> | ||
<v-card-actions> | ||
<v-btn color="white" right> | ||
<v-icon color="#00FFFF">mdi-delete</v-icon> | ||
</v-btn> | ||
<nuxt-link | ||
style="text-decoration: none; color: inherit" | ||
:to="'/luhana/id'" | ||
> | ||
<v-btn text> View Blog </v-btn> | ||
</nuxt-link> | ||
</v-card-actions> | ||
</v-list-item> | ||
</v-card> | ||
</div> | ||
</template> | ||
|
||
<script> | ||
import AddBlog from '../luhana/LuhanaAddBlog.vue' | ||
export default { | ||
name: 'BlogPost', | ||
components: { | ||
AddBlog, | ||
}, | ||
} | ||
</script> | ||
|
||
<style scoped> | ||
.blog-item { | ||
background: #f4f4f4; | ||
padding: 10px; | ||
border-bottom: 1px #ccc dotted; | ||
} | ||
</style> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.