From 6861f9b9128628a7da2790970ac028bbfabfd9cf Mon Sep 17 00:00:00 2001 From: Amanuel Sisay Date: Wed, 3 Aug 2022 17:28:18 +0300 Subject: [PATCH 1/3] created basic ui --- .../components/amanabiy/AmanAddBlog.vue | 50 +++++++++++ .../components/amanabiy/AmanBlog.vue | 84 +++++++++++++++++++ .../pages/amanabiy/_id.vue | 76 +++++++++++++++++ .../pages/amanabiy/index.vue | 25 ++++++ starter-project-web-vue2/pages/index.vue | 5 ++ 5 files changed, 240 insertions(+) create mode 100644 starter-project-web-vue2/components/amanabiy/AmanAddBlog.vue create mode 100644 starter-project-web-vue2/components/amanabiy/AmanBlog.vue create mode 100644 starter-project-web-vue2/pages/amanabiy/_id.vue create mode 100644 starter-project-web-vue2/pages/amanabiy/index.vue diff --git a/starter-project-web-vue2/components/amanabiy/AmanAddBlog.vue b/starter-project-web-vue2/components/amanabiy/AmanAddBlog.vue new file mode 100644 index 00000000..53d520da --- /dev/null +++ b/starter-project-web-vue2/components/amanabiy/AmanAddBlog.vue @@ -0,0 +1,50 @@ + + + diff --git a/starter-project-web-vue2/components/amanabiy/AmanBlog.vue b/starter-project-web-vue2/components/amanabiy/AmanBlog.vue new file mode 100644 index 00000000..e769ebc4 --- /dev/null +++ b/starter-project-web-vue2/components/amanabiy/AmanBlog.vue @@ -0,0 +1,84 @@ + + + diff --git a/starter-project-web-vue2/pages/amanabiy/_id.vue b/starter-project-web-vue2/pages/amanabiy/_id.vue new file mode 100644 index 00000000..ad6f2084 --- /dev/null +++ b/starter-project-web-vue2/pages/amanabiy/_id.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/starter-project-web-vue2/pages/amanabiy/index.vue b/starter-project-web-vue2/pages/amanabiy/index.vue new file mode 100644 index 00000000..c0b84825 --- /dev/null +++ b/starter-project-web-vue2/pages/amanabiy/index.vue @@ -0,0 +1,25 @@ + + + diff --git a/starter-project-web-vue2/pages/index.vue b/starter-project-web-vue2/pages/index.vue index f4de04f5..7abfe742 100644 --- a/starter-project-web-vue2/pages/index.vue +++ b/starter-project-web-vue2/pages/index.vue @@ -67,6 +67,11 @@ export default { description: 'Web Team Member', link: '/liben/articles', }, + { + name: "Amanuel Sisay", + description: "Web Team Member", + link: '/amanabiy', + }, ], } }, From ecbf40b26e00cf1746112b8314473bb4bc58ba57 Mon Sep 17 00:00:00 2001 From: Amanuel Sisay Date: Thu, 4 Aug 2022 01:22:53 +0300 Subject: [PATCH 2/3] implemented state management with dummy data --- .../components/amanabiy/AmanBlog.vue | 42 +++-------- .../pages/amanabiy/_id.vue | 36 ++-------- starter-project-web-vue2/store/amanabiy.js | 70 +++++++++++++++++++ 3 files changed, 86 insertions(+), 62 deletions(-) create mode 100644 starter-project-web-vue2/store/amanabiy.js diff --git a/starter-project-web-vue2/components/amanabiy/AmanBlog.vue b/starter-project-web-vue2/components/amanabiy/AmanBlog.vue index e769ebc4..9235068d 100644 --- a/starter-project-web-vue2/components/amanabiy/AmanBlog.vue +++ b/starter-project-web-vue2/components/amanabiy/AmanBlog.vue @@ -29,7 +29,7 @@ - + mdi-delete @@ -43,42 +43,20 @@ diff --git a/starter-project-web-vue2/pages/amanabiy/_id.vue b/starter-project-web-vue2/pages/amanabiy/_id.vue index ad6f2084..9e580920 100644 --- a/starter-project-web-vue2/pages/amanabiy/_id.vue +++ b/starter-project-web-vue2/pages/amanabiy/_id.vue @@ -9,7 +9,7 @@ {{ curr_blog.title }} {{ curr_blog.id }}{{ curr_blog.title }} @@ -26,6 +26,7 @@ diff --git a/starter-project-web-vue2/store/amanabiy.js b/starter-project-web-vue2/store/amanabiy.js new file mode 100644 index 00000000..225a9a97 --- /dev/null +++ b/starter-project-web-vue2/store/amanabiy.js @@ -0,0 +1,70 @@ +const desc = "Lorem ipsum dolor sit, amet consectetur adipisicing elit. Cum necessitatibus officia labore illo accusamus temporibus commodi eveniet praesentium ullam exercitationem vel nulla, deleniti modi obcaecati laudantium natus soluta laborum quisquam. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Cum necessitatibus officia labore illo accusamus temporibus commodi eveniet praesentium ullam exercitationem vel nulla, deleniti modi obcaecati laudantium natus soluta laborum quisquam. Lorem ipsum dolor sit, amet consectetur adipisicing elit. Cum necessitatibus officia labore illo accusamus temporibus commodi eveniet praesentium ullam exercitationem vel nulla, deleniti modi obcaecati laudantium natus soluta laborum quisquam." + +export const state = { + blogs: [ + { + id: "1", + title: "Why you should Wake up early", + author: "Amanuel Sisay", + desc, + }, + { + id: "2", + title: "Why you should Gym and go to gym", + desc, + author: "Abel", + }, + { + id: "3", + title: "The benifit of Working hard", + desc, + author: "Abebe", + }, + { + id: "4", + title: "Interviews Trick", + desc, + author: "Kebede", + }, + ], +} + +export const actions = { + getBlogs({ commit }) { + commit('getBlogs', state.blogs) + }, + + deleteBlog({ commit }, id) { + commit('deleteBlog', id) + }, + + addBlog({ commit }, addedBlog) { + commit('addBlogs', addedBlog) + }, + + updateBlog({ commit }, updatedBlog) { + commit('updateBlog', updatedBlog) + } + +} + +export const getters = { + // sorted options + + // filtered options + + // filtered + sorterd options +} + +export const mutations = { + getBlogs: (state, blogs) => (state.blogs = blogs), + deleteBlog: (state, id) => { + (state.blogs = state.blogs.filter((blog) => blog.id !== id))}, + editBlog: (state, newBlog) => { + const blogToEdit = state.blogs.filter((blog) => blog.id === newBlog.id)[0] + blogToEdit.title = newBlog.title + blogToEdit.desc = newBlog.desc + blogToEdit.author = newBlog.author + }, + addBlog: (state, newBlog) => { state.blogs.unshift(newBlog)} +} \ No newline at end of file From 5e8eef7cc70c04085e8ff1394c08dbf157a0b903 Mon Sep 17 00:00:00 2001 From: Amanuel Sisay Date: Thu, 4 Aug 2022 10:38:00 +0300 Subject: [PATCH 3/3] created basic ui --- .../components/amanabiy/AmanAddBlog.vue | 50 +++++++++++ .../components/amanabiy/AmanBlog.vue | 84 +++++++++++++++++++ .../pages/amanabiy/_id.vue | 76 +++++++++++++++++ .../pages/amanabiy/index.vue | 25 ++++++ starter-project-web-vue2/pages/index.vue | 5 ++ 5 files changed, 240 insertions(+) create mode 100644 starter-project-web-vue2/components/amanabiy/AmanAddBlog.vue create mode 100644 starter-project-web-vue2/components/amanabiy/AmanBlog.vue create mode 100644 starter-project-web-vue2/pages/amanabiy/_id.vue create mode 100644 starter-project-web-vue2/pages/amanabiy/index.vue diff --git a/starter-project-web-vue2/components/amanabiy/AmanAddBlog.vue b/starter-project-web-vue2/components/amanabiy/AmanAddBlog.vue new file mode 100644 index 00000000..53d520da --- /dev/null +++ b/starter-project-web-vue2/components/amanabiy/AmanAddBlog.vue @@ -0,0 +1,50 @@ + + + diff --git a/starter-project-web-vue2/components/amanabiy/AmanBlog.vue b/starter-project-web-vue2/components/amanabiy/AmanBlog.vue new file mode 100644 index 00000000..e769ebc4 --- /dev/null +++ b/starter-project-web-vue2/components/amanabiy/AmanBlog.vue @@ -0,0 +1,84 @@ + + + diff --git a/starter-project-web-vue2/pages/amanabiy/_id.vue b/starter-project-web-vue2/pages/amanabiy/_id.vue new file mode 100644 index 00000000..ad6f2084 --- /dev/null +++ b/starter-project-web-vue2/pages/amanabiy/_id.vue @@ -0,0 +1,76 @@ + + + + + diff --git a/starter-project-web-vue2/pages/amanabiy/index.vue b/starter-project-web-vue2/pages/amanabiy/index.vue new file mode 100644 index 00000000..c0b84825 --- /dev/null +++ b/starter-project-web-vue2/pages/amanabiy/index.vue @@ -0,0 +1,25 @@ + + + diff --git a/starter-project-web-vue2/pages/index.vue b/starter-project-web-vue2/pages/index.vue index f4de04f5..7abfe742 100644 --- a/starter-project-web-vue2/pages/index.vue +++ b/starter-project-web-vue2/pages/index.vue @@ -67,6 +67,11 @@ export default { description: 'Web Team Member', link: '/liben/articles', }, + { + name: "Amanuel Sisay", + description: "Web Team Member", + link: '/amanabiy', + }, ], } },