pedi2/resources/js/components/NavBar.vue

92 lines
2.7 KiB
Vue
Raw Normal View History

2022-05-25 19:03:29 -03:00
<template>
2023-05-27 20:08:55 -03:00
<nav id="nav-bar" class="navbar is-danger is-fixed-top" role="navigation" aria-label="main navigation">
2022-05-25 19:03:29 -03:00
<div class="navbar-brand">
<a class="navbar-item" href="https://mps.org.uy">
<img src="/assets/logoMPS.png" height="28">
</a>
<!-- Styles nombre del barrio-->
2023-05-27 20:08:55 -03:00
<p class="navbar-item hide-below-1024">
<slot name="gdc"></slot>
</p>
<p class="navbar-item">
<slot name="subpedido"></slot>
</p>
<chismosa-dropdown v-if="this.$root.pedido != null" class="hide-above-1023" id="mobile"></chismosa-dropdown>
2023-05-27 20:08:55 -03:00
<a role="button" class="navbar-burger" :class="{'is-active':burgerActiva}" aria-label="menu" aria-expanded="false" data-target="nav-bar" @click="toggleBurger">
2022-05-25 19:03:29 -03:00
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
<span aria-hidden="true"></span>
</a>
</div>
2023-05-27 20:08:55 -03:00
<div class="navbar-menu" :class="{'is-active':burgerActiva}">
<div class="navbar-end">
2023-05-27 20:08:55 -03:00
<div v-if="this.$root.pedido != null" class="navbar-item field has-addons mt-2 mr-3">
<a class="button is-small has-text-dark-grey" @click.capture="buscar">
2023-05-27 15:33:08 -03:00
<span class="icon">
<i class="fas fa-search"></i>
</span>
</a>
2023-05-27 14:23:52 -03:00
<input class="input is-small" type="text" placeholder="Harina" v-model="searchString" @keyup.enter="buscar" >
</div>
<chismosa-dropdown v-if="this.$root.pedido != null" class="hide-below-1024" id="wide"></chismosa-dropdown>
<div class="block navbar-item">
2023-05-27 20:08:55 -03:00
<a onclick="event.preventDefault(); document.getElementById('logout-form').submit();" class="text-a">
Cerrar sesión
</a>
<slot name="logout-form"></slot>
</div>
2022-05-25 19:03:29 -03:00
</div>
</div>
</nav>
</template>
<script>
2023-05-27 20:08:55 -03:00
import ChismosaDropdown from './ChismosaDropdown.vue';
export default {
components: { ChismosaDropdown },
data() {
return {
burgerActiva: false,
searchString: "",
}
},
methods: {
toggleBurger() {
this.burgerActiva = !this.burgerActiva
},
buscar() {
if (this.burgerActiva) this.toggleBurger()
Event.$emit("migas-setear-como-inicio", this.$rootMiga)
Event.$emit("filtrar-productos",'nombre',this.searchString)
}
},
};
2022-05-25 19:03:29 -03:00
</script>
<style>
p.navbar-item:empty {
display: none;
}
2023-05-27 15:33:08 -03:00
#nav-bar {
z-index: 10;
}
2023-05-27 20:08:55 -03:00
.text-a {
2023-05-27 15:33:08 -03:00
color: inherit;
}
@media (max-width: 1023px) {
2023-05-27 20:08:55 -03:00
.hide-below-1024 {
display: none !important;
}
}
@media (min-width: 1024px) {
.hide-above-1023 {
display: none !important;
}
2022-05-25 19:03:29 -03:00
}
</style>