Usando vuex
This commit is contained in:
parent
5458fae6d9
commit
a9ca04811e
1 changed files with 9 additions and 22 deletions
|
@ -1,32 +1,19 @@
|
||||||
<template>
|
<template>
|
||||||
<div v-show="aprobado" class="notification is-warning has-text-centered">
|
<div v-if="aprobado" class="notification is-warning has-text-centered">
|
||||||
Tu pedido fue <strong>aprobado</strong>, por lo que no puede ser modificado
|
Tu pedido fue <strong>aprobado</strong>, por lo que no puede ser modificado
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
export default {
|
import { mapState } from "vuex";
|
||||||
data() {
|
|
||||||
return {
|
export default {
|
||||||
aprobado: false,
|
name: 'CartelPedidoAprobado',
|
||||||
}
|
computed: {
|
||||||
},
|
...mapState('pedido',["aprobado"]),
|
||||||
mounted() {
|
|
||||||
Event.$on('pedido-actualizado', this.actualizarEstado);
|
|
||||||
if (this.$root.pedido != null) {
|
|
||||||
this.actualizarEstado();
|
|
||||||
}
|
|
||||||
},
|
|
||||||
methods: {
|
|
||||||
pedidoAprobado: function() {
|
|
||||||
return this.$root.pedido.aprobado;
|
|
||||||
},
|
|
||||||
actualizarEstado: function() {
|
|
||||||
this.aprobado = this.pedidoAprobado();
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
</style>
|
</style>
|
||||||
|
|
Loading…
Add table
Reference in a new issue