Cambio de alert a bulma toast y bulma toast duration de 1000 a 1500

This commit is contained in:
Alejandro Tasistro 2022-05-12 23:16:15 -03:00
parent 54e515cb7a
commit be26a48c14
2 changed files with 17 additions and 3 deletions

2
public/js/app.js vendored
View File

@ -61,7 +61,7 @@ Vue.component('nav-bar', {
}).then(() => {
bulmaToast.toast({
message: 'Pedido actualizado exitosamente',
duration: 1000,
duration: 1500,
type: 'is-danger',
position: 'bottom-center',
animate: { in: 'fadeIn', out: 'fadeOut' }

View File

@ -187,8 +187,22 @@ Vue.component('producto-container', {
Event.$emit("migas-pop");
},
agregarProducto() {
if (this.cant < 0) alert("No se puede agregar cantidades negativas")
else if (!Number.isInteger(this.cant)) alert("Las cantidades deben ser números enteros")
if (this.cant < 0)
bulmaToast.toast({
message: 'Las cantidades deben ser números mayores a 0',
duration: 1500,
type: 'is-danger',
position: 'bottom-center',
animate: { in: 'fadeIn', out: 'fadeOut' }
});
else if (!Number.isInteger(this.cant))
bulmaToast.toast({
message: 'Las cantidades deben ser números enteros',
duration: 1500,
type: 'is-danger',
position: 'bottom-center',
animate: { in: 'fadeIn', out: 'fadeOut' }
});
else {
Event.$emit("sync-subpedido", this.cant, this.producto.id);
this.cerrar();