diff --git a/public/js/app.js b/public/js/app.js
index 38d9e2f..bc6b194 100644
--- a/public/js/app.js
+++ b/public/js/app.js
@@ -62,6 +62,9 @@ Vue.component('nav-migas', {
Event.$on('migas-reset', () => {
this.migas = [];
});
+ Event.$on('migas-pop', () => {
+ this.migas.pop();
+ });
}
});
diff --git a/public/js/productos.js b/public/js/productos.js
index be85243..3d58f65 100644
--- a/public/js/productos.js
+++ b/public/js/productos.js
@@ -44,7 +44,7 @@ Vue.component('productos-container', {
-
+
@@ -100,5 +100,72 @@ Vue.component('productos-container', {
this.visible = true;
Event.$emit("migas-agregar",this.miga);
});
+ },
+ methods: {
+ seleccionarProducto(producto) {
+ Event.$emit("producto-seleccionado",producto);
+ }
+ }
+});
+
+Vue.component('producto-container', {
+ template: `
+ `,
+ data() {
+ return {
+ producto: null,
+ visible: false
+ }
+ },
+ computed: {
+ miga: function(){
+ return {
+ nombre: this.producto.nombre,
+ href: "#" + this.producto.nombre
+ }
+ }
+ },
+ methods: {
+ cerrar() {
+ this.visible = false;
+ Event.$emit("migas-pop");
+ }
+ },
+ mounted() {
+ Event.$on('producto-seleccionado', (producto) => {
+ this.producto = producto;
+ this.visible = true;
+ Event.$emit("migas-agregar",this.miga);
+ });
}
});
\ No newline at end of file
diff --git a/resources/views/productos.blade.php b/resources/views/productos.blade.php
index 6234720..906384a 100644
--- a/resources/views/productos.blade.php
+++ b/resources/views/productos.blade.php
@@ -7,6 +7,7 @@
@section('content')
+
@endsection
@section('scripts')