logmower-frontend/src/components/Grid/Main/Filter/Combobox.vue

50 lines
692 B
Vue

<template>
<v-select
v-model="filterValue"
:options="options"
@open="updateOptions"
></v-select>
</template>
<script>
import vSelect from "vue-select"
export default {
name: "Combobox",
components: {
vSelect
},
props: {
field: {
},
changeValue: {
},
filter: {
}
},
data() {
return {
options: []
}
},
computed: {
filterValue: {
get() {
return this.filter
},
set(newValue) {
this.changeValue(newValue)
}
}
},
methods: {
updateOptions() {
this.options = this.$store.state.filterOptions[this.field] ?? []
}
}
}
</script>
<style scoped>
</style>