From 2eac2a95545414eba5911b5544bd8860762432f7 Mon Sep 17 00:00:00 2001 From: Ale Date: Sat, 27 May 2023 11:20:38 -0300 Subject: [PATCH] refactors varios para sacar responsabilidades a la nav bar --- resources/js/app.js | 16 ++++++++++++++ resources/js/components/Login.vue | 2 +- resources/js/components/NavBar.vue | 26 +++++++++++------------ resources/js/components/ProductoModal.vue | 2 +- 4 files changed, 31 insertions(+), 15 deletions(-) diff --git a/resources/js/app.js b/resources/js/app.js index 79de065..3f54d4c 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -21,6 +21,21 @@ window.bulmaToast = require('bulma-toast'); const files = require.context('./', true, /\.vue$/i) files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files(key).default)) +/** + * Global data + */ +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); +} + /** * Next, we will create a fresh Vue application instance and attach it to * the page. Then, you may begin adding components to this application @@ -30,3 +45,4 @@ files.keys().map(key => Vue.component(key.split('/').pop().split('.')[0], files( const app = new Vue({ el: '#root' }); + diff --git a/resources/js/components/Login.vue b/resources/js/components/Login.vue index 46573bf..a008734 100644 --- a/resources/js/components/Login.vue +++ b/resources/js/components/Login.vue @@ -28,7 +28,7 @@ data() { return { visible: false, - gdc: null, + gdc: this.$gdc, passwordVisible: false, passwordType: "password", } diff --git a/resources/js/components/NavBar.vue b/resources/js/components/NavBar.vue index c976854..3fc4aca 100644 --- a/resources/js/components/NavBar.vue +++ b/resources/js/components/NavBar.vue @@ -21,25 +21,25 @@