diff options
author | Adam T. Carpenter <atc@53hor.net> | 2021-01-04 16:57:52 -0500 |
---|---|---|
committer | Adam T. Carpenter <atc@53hor.net> | 2021-01-04 16:57:52 -0500 |
commit | 64027a74f9a15d21d6903cb229353bb0185e3a32 (patch) | |
tree | ee3dbcb55ad37c39c0aaf378d8102ec73ba5baf1 | |
parent | 6991872a00dc25d8009aeca4abbb8fd5c8bf2a5b (diff) | |
download | theglassyladies-64027a74f9a15d21d6903cb229353bb0185e3a32.tar.xz theglassyladies-64027a74f9a15d21d6903cb229353bb0185e3a32.zip |
attempted to speed up search with typing delay
-rw-r--r-- | iridescence/src/components/Navbar.vue | 3 | ||||
-rw-r--r-- | iridescence/src/components/ProductSearch.vue | 8 |
2 files changed, 10 insertions, 1 deletions
diff --git a/iridescence/src/components/Navbar.vue b/iridescence/src/components/Navbar.vue index 6b9f609..3a3390c 100644 --- a/iridescence/src/components/Navbar.vue +++ b/iridescence/src/components/Navbar.vue @@ -21,6 +21,9 @@ <router-link to="/faq" class="navbar-item"> F.A.Q. </router-link> + <router-link to="/about" class="navbar-item"> + About Us + </router-link> <router-link to="/care" class="navbar-item"> Care & Handling </router-link> diff --git a/iridescence/src/components/ProductSearch.vue b/iridescence/src/components/ProductSearch.vue index d492b66..f60931c 100644 --- a/iridescence/src/components/ProductSearch.vue +++ b/iridescence/src/components/ProductSearch.vue @@ -45,6 +45,7 @@ export default { data() { return { term: "", + searchTimer: function() {}, sortOptions: { "Featured Items": a => (a.featured ? -1 : 1), "In Stock": (a, b) => a.quantity < b.quantity, @@ -72,7 +73,10 @@ export default { }, methods: { updateSearch() { - this.$store.commit("searchTerm", this.term); + clearTimeout(this.searchTimer); + this.timeout = setTimeout(() => { + this.$store.commit("searchTerm", this.term); + }, 1000); }, updateSort() { this.$store.commit("compare", this.sortOptions[this.sortOptionName]); @@ -80,3 +84,5 @@ export default { } }; </script> + + |