diff options
Diffstat (limited to 'iridescence')
-rw-r--r-- | iridescence/src/components/Navbar.vue | 28 | ||||
-rw-r--r-- | iridescence/src/components/ProductSearch.vue | 10 | ||||
-rw-r--r-- | iridescence/src/store/index.js | 2 |
3 files changed, 22 insertions, 18 deletions
diff --git a/iridescence/src/components/Navbar.vue b/iridescence/src/components/Navbar.vue index 78627e9..60db834 100644 --- a/iridescence/src/components/Navbar.vue +++ b/iridescence/src/components/Navbar.vue @@ -41,20 +41,12 @@ > <div class="navbar-item has-dropdown is-active" - v-for="category in categories.keys()" + v-for="category in categories" :key="category" > <div class="navbar-link"> {{ category }} </div> - - <div - class="navbar-dropdown" - v-for="subcategory in categories.get(category)" - :key="subcategory" - > - {{ subcategory }} - </div> </div> <div class="navbar-item"> @@ -77,7 +69,7 @@ export default { }, data() { return { - isMenuActive: false + isMenuActive: true }; }, computed: { @@ -89,8 +81,14 @@ export default { } }, categories() { - const products = this.$store.getters.products; - console.log(products.map(item => item.categories)); + //const raw = this.$store.getters.products.map(p => p.category.split("/")); + const raw = [ + [1, 2, 3], + [1, 2, 4], + [1, 5], + [6, 7] + ]; + console.log(this.generateCategories(raw)); return []; }, routeName() { @@ -98,6 +96,12 @@ export default { } }, methods: { + generateCategories(list) { + let results = []; + console.log(list); + + return results; + }, toggleNavMenu() { this.isMenuActive = !this.isMenuActive; } diff --git a/iridescence/src/components/ProductSearch.vue b/iridescence/src/components/ProductSearch.vue index 907602c..7d70a7c 100644 --- a/iridescence/src/components/ProductSearch.vue +++ b/iridescence/src/components/ProductSearch.vue @@ -34,13 +34,13 @@ export default { return { term: "", sortOptions: { - "Featured Items First": (_, b) => b.featured, + "Featured Items": (_, b) => b.featured, "In Stock": (a, b) => a.quantity < b.quantity, "Made to Order": (a, b) => a.quantity > b.quantity, - "Name (A-Z)": (a, b) => a.name > b.name, - "Name (Z-A)": (a, b) => a.name < b.name, - "Date Added (New to Old)": () => 0, - "Date Added (Old to New)": () => 0, + "A to Z": (a, b) => a.name > b.name, + "Z to A": (a, b) => a.name < b.name, + "Newest to Oldest": (a, b) => a.id < b.id, + "Oldest to Newest": (a, b) => a.id > b.id, "Price (Low to High)": (a, b) => a.cents > b.cents, "Price (High to Low)": (a, b) => a.cents < b.cents }, diff --git a/iridescence/src/store/index.js b/iridescence/src/store/index.js index d0d04cb..78ee20b 100644 --- a/iridescence/src/store/index.js +++ b/iridescence/src/store/index.js @@ -11,7 +11,7 @@ export default new Vuex.Store({ searchTerm: "", products: [], busy: false, - compare: () => 0 + compare: (_, b) => b.featured }, getters: { busy(state) { |