diff --git a/resources/js/app.js b/resources/js/app.js index f1a3e33..7c8a5b4 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -24,21 +24,17 @@ files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files( /** * Global data */ -Vue.prototype.$rootMiga = { - nombre: "Categorías", - href: "/productos" - } Vue.prototype.$gdc = null -Vue.prototype.$pedido = { - id: null, - nombre: null, - grupo_de_compra_id: null, - created_at: null, - updated_at: null - } -Vue.prototype.$settearProducto = function(cantidad, id) { - Event.$emit("sync-subpedido", this.cant, this.producto.id); -} +Vue.prototype.$pedido = + {id: null, nombre: null, grupo_de_compra_id: null, created_at: null, updated_at: null} +Vue.prototype.$rootMiga = + {nombre: "Categorías", href: "/productos"} + +/** + * Global methods + */ +Vue.prototype.$settearProducto = + function(cantidad, id) { Event.$emit("sync-subpedido", this.cant, this.producto.id) } /** * Next, we will create a fresh Vue application instance and attach it to diff --git a/resources/js/components/CategoriasContainer.vue b/resources/js/components/CategoriasContainer.vue index 91ab880..b2dab4f 100644 --- a/resources/js/components/CategoriasContainer.vue +++ b/resources/js/components/CategoriasContainer.vue @@ -21,15 +21,14 @@ data() { return { categorias: null, - visible: true, - miga: this.$rootMiga + visible: true } }, mounted() { axios.get("/api/categorias").then(response => { this.categorias = response.data; }); - Event.$emit("migas-setear-como-inicio", this.miga); + Event.$emit("migas-setear-como-inicio", this.$rootMiga); Event.$on("categoria-seleccionada", (_) => this.visible = false) }, methods: { diff --git a/resources/js/components/NavBar.vue b/resources/js/components/NavBar.vue index bcd05ef..c7d758d 100644 --- a/resources/js/components/NavBar.vue +++ b/resources/js/components/NavBar.vue @@ -22,12 +22,16 @@