Desactivar botones de producto cuando no hacen nada

This commit is contained in:
Rodrigo 2024-08-31 23:03:09 -03:00
parent 18ede25c16
commit 078e29a01f
1 changed files with 8 additions and 2 deletions

View File

@ -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>