comenzamos

This commit is contained in:
nat 2022-05-04 16:50:22 -03:00
parent 67aadf157f
commit 70235970ab
4 changed files with 11 additions and 17 deletions

5
public/js/app.js vendored
View File

@ -8,7 +8,7 @@ Vue.component('nav-bar', {
<img src="/assets/logoMPS.png" height="28">
</a>
<p style="margin:0 auto" class="navbar-item"><slot name="subpedido"></slot></p>
<a class="navbar-item" href="/chismosa">
<a class="navbar-item" href="#chismosa" @click.capture="toggleChismosa">
<img style="padding:0 0.3em;" src="/assets/chismosa.png" height="28">
<p style="margin:0 auto; color:white">$ <span v-text="subpedido == null ? 0 : subpedido.total"></span></p>
</a>
@ -47,6 +47,9 @@ Vue.component('nav-bar', {
.then(response => {
this.subpedido = response.data.data;
});
},
toggleChismosa(){
Event.$emit("toggle-chismosa");
}
}, mounted() {
axios.get("/subpedidos/obtener_sesion").then(response => {

View File

@ -1,6 +1,6 @@
Vue.component('chismosa', {
template: `
<div class="container">
<div class="container" v-show="this.visible">
<table v-show="this.subpedido.productos.length != 0" class="table is-fullwidth is-striped is-bordered">
<thead>
<tr>
@ -39,6 +39,7 @@ Vue.component('chismosa', {
subpedido: {
productos:[]
},
visible: false
}
},
computed: {
@ -69,6 +70,9 @@ Vue.component('chismosa', {
Event.$on('sync-subpedido', () => {
this.fetchSubpedido();
});
Event.$on('toggle-chismosa', () => {
this.visible = !this.visible;
});
}
});

View File

@ -1,15 +0,0 @@
@extends('layouts.app')
@section('stylesheets')
@endsection
@section('content')
<chismosa></chismosa>
<producto-container></producto-container>
@endsection
@section('scripts')
<script src="{{ asset('js/chismosa.js') }}"></script>
<script src="{{ asset('js/productos.js') }}"></script>
@endsection

View File

@ -5,6 +5,7 @@
@endsection
@section('content')
<chismosa></chismosa>
<categorias-container></categorias-container>
<productos-container></productos-container>
<producto-container></producto-container>
@ -12,4 +13,5 @@
@section('scripts')
<script src="{{ asset('js/productos.js') }}"></script>
<script src="{{ asset('js/chismosa.js') }}"></script>
@endsection