Browse Source

Add filter button

pull/1251/head
Hironsan 3 years ago
parent
commit
ab1c546f30
1 changed files with 72 additions and 0 deletions
  1. 72
      frontend/components/tasks/toolbar/buttons/ButtonFilter.vue

72
frontend/components/tasks/toolbar/buttons/ButtonFilter.vue

@ -0,0 +1,72 @@
<template>
<v-menu>
<template v-slot:activator="{ on: menu }">
<v-tooltip bottom>
<template v-slot:activator="{ on: tooltip }">
<v-btn
icon
v-on="{ ...tooltip, ...menu }"
>
<v-icon>
mdi-filter
</v-icon>
</v-btn>
</template>
<span>{{ $t('annotation.selectFilterTooltip') }}</span>
</v-tooltip>
</template>
<v-list>
<v-list-item-group v-model="selected" mandatory>
<v-list-item
v-for="(item, i) in items"
:key="i"
>
<v-list-item-icon>
<v-icon v-if="selected === i">
mdi-check
</v-icon>
</v-list-item-icon>
<v-list-item-content>
<v-list-item-title>
{{ item.title }}
</v-list-item-title>
</v-list-item-content>
</v-list-item>
</v-list-item-group>
</v-list>
</v-menu>
</template>
<script>
export default {
props: {
value: {
type: String,
default: '',
required: true
}
},
data() {
return {
items: [
{ title: this.$t('annotation.filterOption1'), param: '' },
{ title: this.$t('annotation.filterOption2'), param: 'false' },
{ title: this.$t('annotation.filterOption3'), param: 'true' }
]
}
},
computed: {
selected: {
get() {
const index = this.items.findIndex(item => item.param === this.value)
return index === -1 ? 0 : index
},
set(value) {
this.$emit('click:filter', this.items[value].param)
}
}
}
}
</script>
Loading…
Cancel
Save