blob: fbcaabb283844e1a2ecfa9a38ebbe8f68fda8622 (
plain) (
tree)
|
|
<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>
|