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 @@