summaryrefslogtreecommitdiff
path: root/iridescence/src/components/InventorySearch.vue
diff options
context:
space:
mode:
authorAdam Carpenter <atc@53hor.net>2020-04-30 21:31:30 -0400
committerAdam Carpenter <atc@53hor.net>2020-04-30 21:31:30 -0400
commitc499946400c775f311d52236d9d1fef3f19a68ff (patch)
treeccff75f9679f3c23e4e9c7c3c04855e6be846adf /iridescence/src/components/InventorySearch.vue
parent9119c86ff94fd29086dfd342a616993f20fc5c75 (diff)
downloadtheglassyladies-c499946400c775f311d52236d9d1fef3f19a68ff.tar.xz
theglassyladies-c499946400c775f311d52236d9d1fef3f19a68ff.zip
moved search into InventorySearch and started work on filters; updated quantity display
Diffstat (limited to 'iridescence/src/components/InventorySearch.vue')
-rw-r--r--iridescence/src/components/InventorySearch.vue36
1 files changed, 36 insertions, 0 deletions
diff --git a/iridescence/src/components/InventorySearch.vue b/iridescence/src/components/InventorySearch.vue
new file mode 100644
index 0000000..fbcaabb
--- /dev/null
+++ b/iridescence/src/components/InventorySearch.vue
@@ -0,0 +1,36 @@
+<template>
+ <div id="inventorySearch">
+ <input
+ class="input is-primary is-medium"
+ type="text"
+ placeholder="Find something in particular..."
+ v-model.trim="term"
+ @input="updateSearch"
+ autofocus
+ />
+ <content class="has-text-centered" v-if="noResults">
+ <p>We couldn't find anything like that...</p>
+ </content>
+ </div>
+</template>
+
+<script>
+export default {
+ name: "InventorySearch",
+ data() {
+ return {
+ term: ""
+ };
+ },
+ computed: {
+ noResults() {
+ return !this.$store.getters.inventory.length;
+ }
+ },
+ methods: {
+ updateSearch() {
+ this.$store.commit("filterTerm", this.term);
+ }
+ }
+};
+</script>