2023-07-11 10:38:21 +03:00
|
|
|
<script setup lang="ts">
|
|
|
|
import { computed } from 'vue'
|
|
|
|
import UiField from './Field.vue'
|
|
|
|
|
|
|
|
const props = defineProps<{
|
|
|
|
modelValue?: string | number,
|
|
|
|
options: { value: string, text: string }[]
|
|
|
|
}>()
|
|
|
|
|
|
|
|
const emit = defineEmits<{ (e: 'update:modelValue', v?: any): void }>()
|
|
|
|
|
|
|
|
const displayValue = computed({
|
|
|
|
get: () => props.modelValue,
|
|
|
|
set: (val) => emit('update:modelValue', val)
|
|
|
|
})
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<template>
|
2023-07-26 14:07:17 +03:00
|
|
|
<ui-field tag="select" class="ui-field-select">
|
2023-07-11 10:38:21 +03:00
|
|
|
<option v-for="opt in props.options" :value="opt.value">
|
|
|
|
{{opt.text}}
|
|
|
|
</option>
|
|
|
|
</ui-field>
|
|
|
|
</template>
|