How to use the vuelidate/lib/validators.between function in vuelidate

To help you get started, we’ve selected a few vuelidate examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github luniehq / lunie / src / components / ActionModal / DevTransaction.vue View on Github external
validations() {
    return {
      gasPrice: {
        required: requiredIf(
          () => this.step === feeStep && this.session.experimentalMode
        ),
        // we don't use SMALLEST as min gas price because it can be a fraction of uatom
        // min is 0 because we support sending 0 fees
        between: between(0, atoms(this.balance))
      }
    }
  }
}
github bytefury / crater / resources / assets / js / components / base / modal / TaxTypeModal.vue View on Github external
computed: {
    ...mapGetters('modal', [
      'modalDataID',
      'modalData',
      'modalActive'
    ])
  },
  validations: {
    formData: {
      name: {
        required,
        minLength: minLength(3)
      },
      percent: {
        required,
        between: between(0.10, 100)
      },
      description: {
        maxLength: maxLength(255)
      }
    }
  },
  // watch: {
  //   'modalDataID' (val) {
  //     if (val) {
  //       this.isEdit = true
  //       this.setData()
  //     } else {
  //       this.isEdit = false
  //     }
  //   },
  //   'modalActive' (val) {
github bytefury / crater / resources / assets / js / views / estimates / Create.vue View on Github external
validations () {
    return {
      newEstimate: {
        estimate_date: {
          required
        },
        expiry_date: {
          required
        },
        estimate_number: {
          required
        },
        discount_val: {
          between: between(0, this.subtotal)
        },
        notes: {
          maxLength: maxLength(255)
        },
        reference_number: {
          maxLength: maxLength(255)
        }
      },
      selectedCustomer: {
        required
      }
    }
  },
  computed: {
github bytefury / crater / resources / assets / js / views / invoices / Item.vue View on Github external
item: {
        name: {
          required
        },
        quantity: {
          required,
          minValue: minValue(1),
          maxLength: maxLength(20)
        },
        price: {
          required,
          minValue: minValue(1),
          maxLength: maxLength(20)
        },
        discount_val: {
          between: between(0, this.maxDiscount)
        },
        description: {
          maxLength: maxLength(255)
        }
      }
    }
  },
  created () {
github luniehq / lunie / app / src / renderer / components / PageSend.vue View on Github external
amount: null,
      denom: ''
    },
    sending: false
  }),
  validations: {
    fields: {
      address: {
        required,
        minLength: minLength(39),
        maxLength: maxLength(42),
        alphaNum: alphaNum
      },
      amount: {
        required,
        between: between(1, 1000000)
      },
      denom: {
        required
      }
    }
  }
}
github bytefury / crater / resources / assets / js / views / estimates / Item.vue View on Github external
item: {
        name: {
          required
        },
        quantity: {
          required,
          minValue: minValue(1),
          maxLength: maxLength(20)
        },
        price: {
          required,
          minValue: minValue(1),
          maxLength: maxLength(20)
        },
        discount_val: {
          between: between(0, this.maxDiscount)
        },
        description: {
          maxLength: maxLength(255)
        }
      }
    }
  },
  created () {
github bytefury / crater / resources / assets / js / views / invoices / Create.vue View on Github external
validations () {
    return {
      newInvoice: {
        invoice_date: {
          required
        },
        due_date: {
          required
        },
        invoice_number: {
          required
        },
        discount_val: {
          between: between(0, this.subtotal)
        },
        notes: {
          maxLength: maxLength(255)
        },
        reference_number: {
          maxLength: maxLength(255)
        }
      },
      selectedCustomer: {
        required
      }
    }
  },
  computed: {
github luniehq / lunie / src / components / ActionModal / ModalPropose.vue View on Github external
maxLength: maxLength(this.titleMaxLength),
        notBlank
      },
      description: {
        required,
        minLength: minLength(1),
        maxLength: maxLength(this.descriptionMaxLength),
        notBlank
      },
      type: {
        isValid
      },
      amount: {
        required: x => !!x && x !== `0`,
        decimal,
        between: between(SMALLEST, atoms(this.balance))
      }
    }
  },
  methods: {
github luniehq / lunie / src / ActionModal / components / ModalDeposit.vue View on Github external
validations() {
    return {
      amount: {
        required: x => !!x && x !== `0`,
        decimal,
        between: between(SMALLEST, this.balance.amount)
      }
    }
  },
  methods: {