2022-05-25 19:03:29 -03:00
|
|
|
<template>
|
|
|
|
<div class="block">
|
|
|
|
<div class="field">
|
2022-06-08 15:18:14 -03:00
|
|
|
<label class="label" :class="whiteText ? 'has-text-white' : ''">Seleccioná tu región</label>
|
2022-05-25 19:03:29 -03:00
|
|
|
<div class="control">
|
|
|
|
<div class="select">
|
|
|
|
<select @change="onRegionSelected" v-model="region">
|
2022-06-08 15:18:14 -03:00
|
|
|
<option :disabled="isDefaultDisabled===1" value=null>Seleccionar</option>
|
2022-05-25 19:03:29 -03:00
|
|
|
<option v-for="region in regiones" v-text="region" :name="region"></option>
|
|
|
|
</select>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
regiones: [],
|
|
|
|
isDefaultDisabled: 0,
|
2022-06-08 15:18:14 -03:00
|
|
|
region: null,
|
|
|
|
whiteText: this.admin == null ? false : this.admin
|
2022-05-25 19:03:29 -03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
axios.get("/api/regiones").then(response => this.regiones = response.data);
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
onRegionSelected() {
|
|
|
|
this.isDefaultDisabled = 1;
|
|
|
|
Event.$emit("region-seleccionada",this.region);
|
|
|
|
}
|
2022-06-08 15:18:14 -03:00
|
|
|
},
|
|
|
|
props: {'admin': Boolean}
|
2022-05-25 19:03:29 -03:00
|
|
|
}
|
2022-06-08 15:18:14 -03:00
|
|
|
</script>
|