yunohost-admin/app/src/components/AdressInputSelect.vue

36 lines
973 B
Vue
Raw Normal View History

<template>
<b-input-group>
<b-input
2020-08-03 19:32:53 +02:00
:id="id" :placeholder="placeholder"
:state="state" :aria-describedby="feedbackId"
v-model="value[0]" @update="$emit('input', value)"
/>
<b-input-group-append>
2020-08-03 19:32:53 +02:00
<b-input-group-text>{{ separator }}</b-input-group-text>
</b-input-group-append>
<b-input-group-append>
<b-select
v-model="value[1]" :options="options" @change="$emit('input', value)"
/>
</b-input-group-append>
</b-input-group>
</template>
<script>
export default {
2020-08-03 19:32:53 +02:00
name: 'AdressInputSelect',
props: {
// `value` is actually passed thru the `v-model` directive
value: { type: Array, required: true },
2020-08-03 19:32:53 +02:00
options: { type: Array, required: true },
separator: { type: String, default: '@' },
placeholder: { type: String, default: null },
id: { type: String, default: null },
state: { type: null, default: null },
feedbackId: { type: String, default: null }
}
}
</script>