Set up the Options view bound to the prefs & settings stores

This commit is contained in:
Bubka
2023-10-04 09:30:05 +02:00
parent 39281ec428
commit c448628e1b
18 changed files with 557 additions and 42 deletions

View File

@ -0,0 +1,39 @@
<script setup>
const props = defineProps({
modelValue: [String, Number, Boolean],
label: {
type: String,
default: ''
},
fieldName: {
type: String,
default: '',
required: true
},
options: {
type: Array,
required: true
},
help: {
type: String,
default: ''
},
})
const selected = ref(props.modelValue)
</script>
<template>
<div class="field">
<label class="label" v-html="$t(label)"></label>
<div class="control">
<div class="select">
<select v-model="selected" v-on:change="$emit('update:modelValue', $event.target.value)">
<option v-for="option in options" :value="option.value">{{ $t(option.text) }}</option>
</select>
</div>
</div>
<!-- <FieldError :form="form" :field="fieldName" /> -->
<p class="help" v-html="$t(help)" v-if="help"></p>
</div>
</template>