From b39fb9c76eb3b598277dc4ba61a8e308088ee52b Mon Sep 17 00:00:00 2001 From: Giyos Date: Fri, 21 Sep 2018 18:09:32 +0500 Subject: [PATCH 1/2] Search input added to header --- front/client/components/Article.vue | 48 ++++++++-------------- front/client/components/Categories.vue | 4 +- front/client/components/Search.vue | 10 ++++- front/client/components/Toolbar.vue | 6 +-- front/client/service/Category.ts | 7 ---- front/client/service/CategoryItem.ts | 23 +++++++++++ front/client/store/index.ts | 4 +- front/client/store/modules/category.ts | 5 --- front/client/store/modules/categoryItem.ts | 35 ++++++++++++++++ 9 files changed, 90 insertions(+), 52 deletions(-) create mode 100644 front/client/service/CategoryItem.ts create mode 100644 front/client/store/modules/categoryItem.ts diff --git a/front/client/components/Article.vue b/front/client/components/Article.vue index 6a58c7f..a4c6df2 100644 --- a/front/client/components/Article.vue +++ b/front/client/components/Article.vue @@ -1,10 +1,13 @@ @@ -17,42 +20,23 @@ import Component from 'vue-class-component' export default class ArticleItem extends Vue { async asyncData({ store }) { - return store.dispatch('category/loadCategoryItem') + return store.dispatch('categoryItem/loadCategoryItem') } get getCategory () { - return typeof this.$store.state.category.categoryList + return typeof this.$store.state.categoryItem.categoryItemList } get getCategoryDescription() { - // let rawDescription = this.$store.state.category.categoryList.description.html; - - // let parsedDescription = new DOMParser().parseFromString(rawDescription) - - // return typeof this.$store.state.category.categoryList.description.html - // return parsedDescription - return this.$store.state.category.categoryList + const description = this.$store.state.categoryItem.categoryItemList.description.html; + return description } - // const computed = { - // getCategory: function() { - // const categoryData = this.$store.state.category.categoryList.items; + get getCategoryItems() { + const items = this.$store.state.categoryItem.categoryItemList.items + const parsedItems = items.map((item:any) => {return item.ecosystem.html}) - // // categoryData.map() => { - - // // } - - // return this.$store.state.category.categoryList.items - // }, - - // getCategoryDescription: function() { - // return this.$store.state.category.categoryList.description.html - // } - // } - - // stripHtml() { - // const categoryData: any[] = computed.getCategory(); - // } - // const parser = new DOMParser() + return parsedItems + } } diff --git a/front/client/components/Categories.vue b/front/client/components/Categories.vue index 139445f..7066a85 100644 --- a/front/client/components/Categories.vue +++ b/front/client/components/Categories.vue @@ -17,9 +17,9 @@ :key="index" > - +

diff --git a/front/client/components/Search.vue b/front/client/components/Search.vue index 9db3744..2c5c644 100644 --- a/front/client/components/Search.vue +++ b/front/client/components/Search.vue @@ -1,5 +1,5 @@ + + diff --git a/front/client/components/Toolbar.vue b/front/client/components/Toolbar.vue index e4bdea9..b29ba9c 100644 --- a/front/client/components/Toolbar.vue +++ b/front/client/components/Toolbar.vue @@ -3,7 +3,7 @@ Aelve Guide - + Login @@ -12,13 +12,13 @@ -