blob: d452e8371fde535136e71246166bedb7482d9a5c (
plain) (
tree)
|
|
<template>
<div id="productSearch">
<div class="field is-grouped is-grouped-multiline">
<div class="control is-expanded">
<input
class="input is-primary is-medium"
type="text"
placeholder="Find something in particular..."
v-model.trim="term"
@input="updateSearch"
autofocus
/>
</div>
<div class="control">
<div class="select is-primary is-medium">
<select>
<option>Featured</option>
<option>Name/A-Z</option>
<option>Newest to Oldest</option>
<option>Oldest to Newest</option>
<option>Low to High</option>
<option>High to Low</option>
</select>
</div>
</div>
</div>
<content class="has-text-centered" v-if="noResults">
<p>We couldn't find anything like that...</p>
</content>
</div>
</template>
<script>
export default {
name: "ProductSearch",
data() {
return {
term: ""
};
},
computed: {
noResults() {
return !this.$store.getters.products.length;
}
},
methods: {
updateSearch() {
this.$store.commit("searchTerm", this.term);
}
}
};
</script>
|