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

46 lines
1.1 KiB
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>
2020-08-07 19:04:22 +02:00
<style lang="scss" scoped>
.input-group-append ~ .input-group-append {
min-width: 40%;
}
select {
border-top-left-radius: 0;
border-bottom-left-radius: 0;
}
</style>