Desactivar botones de producto cuando no hacen nada
This commit is contained in:
parent
18ede25c16
commit
078e29a01f
|
@ -35,6 +35,12 @@ export default {
|
|||
this.producto.cantidad = cantidad;
|
||||
this.enChismosa = cantidad;
|
||||
},
|
||||
hayCambios() {
|
||||
return this.cantidad != this.enChismosa;
|
||||
},
|
||||
puedeBorrar() {
|
||||
return this.enChismosa > 0;
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
@ -70,12 +76,12 @@ export default {
|
|||
<i class="fa fa-solid fa-plus"></i>
|
||||
</button>
|
||||
</div>
|
||||
<button class="button is-small is-success ml-3" @click="confirmar()">
|
||||
<button :disabled="!hayCambios()" class="button is-small is-success ml-3" @click="confirmar()">
|
||||
<span class="icon">
|
||||
<i class="fas fa-check"></i>
|
||||
</span>
|
||||
</button>
|
||||
<button class="button is-small is-danger ml-3" @click="borrar()">
|
||||
<button :disabled="!puedeBorrar()" class="button is-small is-danger ml-3" @click="borrar()">
|
||||
<span class="icon">
|
||||
<i class="fas fa-trash-alt"></i>
|
||||
</span>
|
||||
|
|
Loading…
Reference in New Issue