-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
accordionの中身の要素を入れた / 適切なArrayがなかったのでベタ打ち
- Loading branch information
Showing
1 changed file
with
43 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |