Como podría obtener correctamente los datos? Estoy intentando obtener los datos con el siguiente formato 1997 - 1998 CI
El select al cual le estoy pasando los datos que se encuentran en base, en el cual llamo al metodo getPeriodoMalla
que tengo en el script
<select v-model="periodoLectivo" class="form-control col-md-12" @click="getPeriodoMalla()">
<option v-for="periodo in arrayPeriodo" :key="periodo">{{periodo}}</option>
</select>
El script
<script>
export default {
data() {
return {
periodoLectivo: '',
pAcademInicio: '',
cicloInicio: '',
arrayPeriodo: [],
}
},
methods: {
getPeriodoMalla() {
let me = this;
var url = '/mallamaterias/periodolectivo';
axios.get(url).then(function(response) {
var respuesta = response.data;
me.arrayPeriodo = respuesta.periodo;
me.pAcademicoInicio = arrayPeriodo[0]['pAcademicoInicio'];
me.pAcademicoFin=arrayPeriodo[0]['pAcademicoFin'];
me.cicloLectivoInicio=arrayPeriodo[0]['cicloLectivoInicio'];
me.periodoLectivo = me.pAcademicoInicio + ' - ' +me.pAcademicoFin + ' ' + me.cicloLectivoInicio;
})
.catch(function(error) {
console.log(error);
});
}
}