Skip to content

Instantly share code, notes, and snippets.

@samouss
Last active January 2, 2018 09:15
Show Gist options
  • Save samouss/201ebb680a915407196a2c3aed8bcf7e to your computer and use it in GitHub Desktop.
Save samouss/201ebb680a915407196a2c3aed8bcf7e to your computer and use it in GitHub Desktop.
<template>
<select @change="handleChange($event)">
<option
v-for="facet in facetValues"
:key="facet.name"
:value="facet.path"
>
{{facet.name}} ({{facet.count}})
</option>
</select>
</template>
<script>
import { Menu } from 'vue-instantsearch';
export default {
extends: Menu,
methods: {
handleChange(event) {
this.searchStore.toggleFacetRefinement(this.attribute, event.target.value);
}
}
};
</script>
// Usage
<custom-menu-select
attribute="course_rating"
:sort-by="['name:desc']"
/>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment