mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 05:44:24 +00:00
keep this unused subcomponent file, wrote for Address with household
This commit is contained in:
parent
028af50dbc
commit
fbf343dd19
@ -0,0 +1,47 @@
|
|||||||
|
<template>
|
||||||
|
<div class="container">
|
||||||
|
<VueMultiselect
|
||||||
|
v-model="value"
|
||||||
|
@select="selectAddress"
|
||||||
|
name="field"
|
||||||
|
track-by="id"
|
||||||
|
label="value"
|
||||||
|
:custom-label="transName"
|
||||||
|
:multiple="false"
|
||||||
|
:placeholder="$t('select_address')"
|
||||||
|
:options="addresses">
|
||||||
|
</VueMultiselect>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import VueMultiselect from 'vue-multiselect';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'SelectHouseholdAddress',
|
||||||
|
components: { VueMultiselect },
|
||||||
|
props: ['address'],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
value: null
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
addresses() {
|
||||||
|
return this.address.loaded.addresses;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
transName(value) {
|
||||||
|
return `${value.text} ${value.postcode.name}`
|
||||||
|
},
|
||||||
|
selectAddress(value) {
|
||||||
|
this.address.selected.address = value;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style src="vue-multiselect/dist/vue-multiselect.css"></style>
|
||||||
|
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user