2022-01-13 20:15:46 -03:00
|
|
|
window.Event = new Vue();
|
|
|
|
|
2022-01-08 23:56:37 -03:00
|
|
|
Vue.component('nav-bar', {
|
|
|
|
template: `
|
2022-01-13 20:15:46 -03:00
|
|
|
<nav class="navbar is-danger" role="navigation" aria-label="main navigation">
|
2022-01-08 23:56:37 -03:00
|
|
|
<div class="navbar-brand">
|
|
|
|
<a class="navbar-item" href="https://bulma.io">
|
|
|
|
<img src="/assets/logoMPS.png" height="28">
|
|
|
|
</a>
|
2022-01-11 17:34:34 -03:00
|
|
|
<p style="margin:0 auto" class="navbar-item"><slot name="subpedido"></slot></p>
|
2022-01-08 23:56:37 -03:00
|
|
|
<a role="button" class="navbar-burger" :class="{'is-active':isActive}" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample" @click="toggleState">
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
<span aria-hidden="true"></span>
|
|
|
|
</a>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div id="navbarBasicExample" class="navbar-menu" :class="{'is-active':isActive}">
|
|
|
|
<div class="navbar-start has-text-right-mobile">
|
|
|
|
<!-- Styles nombre del barrio-->
|
|
|
|
<p class="navbar-item"><slot name="gdc"></slot></p>
|
|
|
|
<a class="navbar-item"
|
|
|
|
onclick="event.preventDefault();
|
|
|
|
document.getElementById('logout-form').submit();">
|
|
|
|
Cerrar sesión
|
|
|
|
</a>
|
|
|
|
<slot name="logout-form"></slot>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>`,
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
isActive: false
|
|
|
|
}
|
|
|
|
},
|
|
|
|
methods: {
|
|
|
|
toggleState() {
|
|
|
|
this.isActive = !this.isActive;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-01-13 20:15:46 -03:00
|
|
|
Vue.component('nav-migas', {
|
|
|
|
data() {
|
|
|
|
return {
|
|
|
|
migas: []
|
|
|
|
}
|
|
|
|
},
|
|
|
|
computed: {
|
|
|
|
visible: function() {
|
|
|
|
return this.migas.length > 0
|
|
|
|
}
|
|
|
|
},
|
|
|
|
mounted() {
|
|
|
|
Event.$on('migas-setear-como-inicio', (miga) => {
|
|
|
|
this.migas = [];
|
|
|
|
this.migas.push(miga);
|
|
|
|
});
|
|
|
|
Event.$on('migas-agregar', (miga) => {
|
|
|
|
this.migas.push(miga);
|
|
|
|
});
|
|
|
|
Event.$on('migas-reset', () => {
|
|
|
|
this.migas = [];
|
|
|
|
});
|
2022-01-24 14:21:24 -03:00
|
|
|
Event.$on('migas-pop', () => {
|
|
|
|
this.migas.pop();
|
|
|
|
});
|
2022-01-13 20:15:46 -03:00
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2022-01-08 23:56:37 -03:00
|
|
|
new Vue({
|
|
|
|
el: '#app'
|
|
|
|
});
|