Skip to content

Commit

Permalink
accordionの中身の要素を入れた / 適切なArrayがなかったのでベタ打ち
Browse files Browse the repository at this point in the history
  • Loading branch information
Pugma committed Dec 5, 2023
1 parent f819c30 commit 3d41f71
Showing 1 changed file with 43 additions and 0 deletions.
43 changes: 43 additions & 0 deletions src/components/UI/EventTypeAccordion.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
<script lang="ts" setup>
import { computed } from 'vue'
import BaseSelect from '/@/components/UI/BaseSelect.vue'
import { EventLevel } from '/@/lib/apis'
import {
eventLevelValueMap,
getEventLevelFromValue
} from '/@/consts/eventLevel'
interface Props {
modelValue: EventLevel
}
const props = defineProps<Props>()
const emit = defineEmits<{
(e: 'update:modelValue', value: EventLevel): void
}>()
const value = computed({
get: () => eventLevelValueMap[props.modelValue],
set: v =>
emit('update:modelValue', getEventLevelFromValue(v) ?? EventLevel.Anonymous)
})
const options = [
{
label: eventLevelValueMap[EventLevel.Anonymous],
value: eventLevelValueMap[EventLevel.Anonymous]
},
{
label: eventLevelValueMap[EventLevel.Private],
value: eventLevelValueMap[EventLevel.Private]
},
{
label: eventLevelValueMap[EventLevel.Public],
value: eventLevelValueMap[EventLevel.Public]
}
]
</script>

<template>
<base-select v-model="value" :options="options" searchable />
</template>

0 comments on commit 3d41f71

Please sign in to comment.