————————————————————————
<template>
<select @change=”on_change($event.target)” :value=”value”
class=”form-control” name=”country” required>
<option v-for=”country in countries” :value=”country.value”>
{{country.name}}
</option>
</select>
</template>
methods: {
on_change(target){
this.$emit(‘input’, target.value)
}
}
————————————————————–
<countries v-if=”countries_fetched” v-model=”country_value” />
computed: {
country_value: {
get: function(){
return this.$store.getters[‘location/country_value’]
},
set: function(value){
this.$store.commit(‘location/set_country_value’, value)
}
}