From 6991872a00dc25d8009aeca4abbb8fd5c8bf2a5b Mon Sep 17 00:00:00 2001 From: "Adam T. Carpenter" Date: Mon, 4 Jan 2021 16:41:42 -0500 Subject: sped up searching by only searching product fields that matter, cleaned up nav --- iridescence/src/store/index.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'iridescence/src/store') diff --git a/iridescence/src/store/index.js b/iridescence/src/store/index.js index e2d970d..b324bd1 100644 --- a/iridescence/src/store/index.js +++ b/iridescence/src/store/index.js @@ -19,7 +19,13 @@ export default new Vuex.Store({ products(state) { return state.products .filter(item => { - return JSON.stringify(item) + let haystack = [ + item.id, + item.name, + item.description, + item.category + ].join(""); + return haystack .toLowerCase() .includes(state.searchTerm.toLowerCase()); }) -- cgit v1.2.3