mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-12 21:34:25 +00:00
addresses form: add default country value
This commit is contained in:
parent
165012b302
commit
935006eae3
@ -168,12 +168,13 @@ export default {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.getCountries();
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
openModal() {
|
openModal() {
|
||||||
this.modal.showModal = true;
|
this.modal.showModal = true;
|
||||||
this.resetAll();
|
this.resetAll();
|
||||||
this.getCountries();
|
|
||||||
|
|
||||||
//this.$nextTick(function() {
|
//this.$nextTick(function() {
|
||||||
// this.$refs.search.focus(); // positionner le curseur à l'ouverture de la modale
|
// this.$refs.search.focus(); // positionner le curseur à l'ouverture de la modale
|
||||||
//})
|
//})
|
||||||
|
@ -22,24 +22,28 @@ export default {
|
|||||||
props: ['address', 'getCities'],
|
props: ['address', 'getCities'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
//value: this.address.loaded.countries.filter(c => c.countryCode === 'FR')[0],
|
value: this.address.loaded.countries.filter(c => c.countryCode === 'FR')[0]
|
||||||
value: null
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
init() {
|
||||||
|
if (this.value !== undefined) {
|
||||||
|
this.getCities(this.value);
|
||||||
|
}
|
||||||
|
},
|
||||||
transName ({ name }) {
|
transName ({ name }) {
|
||||||
return name.fr //TODO multilang
|
return name.fr //TODO multilang
|
||||||
},
|
},
|
||||||
selectCountry(value) {
|
selectCountry(value) {
|
||||||
|
console.log(value);
|
||||||
this.address.selected.country = value;
|
this.address.selected.country = value;
|
||||||
this.getCities(value);
|
this.getCities(value);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted(){
|
||||||
|
this.init()
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
// defaultCountry() {
|
|
||||||
// const countries = this.address.loaded.countries;
|
|
||||||
// return countries.filter(c => c.countryCode === 'FR')[0];
|
|
||||||
// },
|
|
||||||
countries() {
|
countries() {
|
||||||
const countries = this.address.loaded.countries;
|
const countries = this.address.loaded.countries;
|
||||||
let orderedCountries = [];
|
let orderedCountries = [];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user