2022-05-25 19:03:29 -03:00
|
|
|
<template>
|
|
|
|
<div v-show="visible" class="container">
|
|
|
|
<div class="columns is-multiline is-mobile">
|
2023-05-27 14:23:52 -03:00
|
|
|
<div v-for="(categoria,i) in categorias" :key="i" class="block column is-one-quarter-desktop is-one-third-tablet is-half-mobile">
|
|
|
|
<div @click.capture="seleccionarCategoria(categoria)" class="card" style="height:100%" >
|
2022-05-25 19:03:29 -03:00
|
|
|
<div class="card-content">
|
|
|
|
<div class="media">
|
|
|
|
<div class="media-content" style="overflow:hidden">
|
2023-05-27 14:23:52 -03:00
|
|
|
<p class="title is-6" v-text="categoria"></p>
|
2022-05-25 19:03:29 -03:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div><!-- END CARD -->
|
|
|
|
</div><!-- END BLOCK COLUMN -->
|
|
|
|
</div><!-- END COLUMNS -->
|
|
|
|
</div><!-- END CONTAINER -->
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script>
|
|
|
|
export default {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
categorias: null,
|
|
|
|
visible: true,
|
2023-05-27 14:23:52 -03:00
|
|
|
miga: this.$rootMiga
|
2022-05-25 19:03:29 -03:00
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
axios.get("/api/categorias").then(response => {
|
|
|
|
this.categorias = response.data;
|
|
|
|
});
|
2023-05-27 14:23:52 -03:00
|
|
|
Event.$emit("migas-setear-como-inicio", this.miga);
|
|
|
|
Event.$on("categoria-seleccionada", (_) => this.visible = false)
|
2022-05-25 19:03:29 -03:00
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
seleccionarCategoria(categoria) {
|
|
|
|
this.visible = false;
|
2023-05-27 14:23:52 -03:00
|
|
|
Event.$emit("categoria-seleccionada",'categoria',categoria);
|
2022-05-25 19:03:29 -03:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
</script>
|