42 lines
1.2 KiB
Vue
42 lines
1.2 KiB
Vue
<template>
|
|
<div class="dropdown is-right navbar-item" :class="{'is-active': show_chismosa}">
|
|
<div class="dropdown-trigger">
|
|
<a class="text-a" aria-haspopup="true" :aria-controls="ariaControls" @click.capture="toggleChismosa">
|
|
<span class="icon is-small mr-1">
|
|
<img src="/assets/chismosa.png">
|
|
</span>
|
|
<span v-text="textoChismosa"/>
|
|
</a>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
import Chismosa from './Chismosa.vue'
|
|
import { mapGetters, mapMutations, mapState } from "vuex";
|
|
export default {
|
|
components: {
|
|
Chismosa
|
|
},
|
|
props: {
|
|
ariaControls: {
|
|
type: String,
|
|
required: true
|
|
}
|
|
},
|
|
computed: {
|
|
...mapState('pedido',["total"]),
|
|
...mapState('ui',["show_chismosa"]),
|
|
...mapState('login', ["rol"]),
|
|
...mapGetters('ollas', ["montoTotal"]),
|
|
textoChismosa() {
|
|
if (this.rol === 'ollas')
|
|
return `$${this.total} / $${this.montoTotal}`;
|
|
return `$${this.total}`;
|
|
},
|
|
},
|
|
methods: {
|
|
...mapMutations('ui',["toggleChismosa"]),
|
|
},
|
|
}
|
|
</script>
|