How to use the vuelidate/lib/validators.maxValue 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 ezaquarii / vpn-at-home / frontend / src / components / NewClientForm.vue View on Github external
return {
            open: false,
            form: {
                name: '',
                server: this.servers[0].id,
                validity_time: 1,
                validity_time_unit: 'years'
            }
        };
    },
    validations: {
        form: {
            name: { required },
            validity_time: {
                minValue: minValue(1),
                maxValue: maxValue(1000)
            },
            validity_time_unit: {
                timeUnitValid: isTimeUnitValid
            }
        }
    },
    computed: {
        isValid () {
            return !this.$v.$invalid;
        },
        value () {
            return { ...this.form };
        }
    },
    mounted () {
        this.$emit('formUpdated', this.isValid);
github ezaquarii / vpn-at-home / frontend / src / components / NewServerForm.vue View on Github external
validity_time: 1,
                validity_time_unit: 'years'
            }
        };
    },
    validations: {
        form: {
            name: { required },
            hostname: { required },
            port: { required },
            protocol: { required },
            network: { required },
            deploy_dns: { required },
            validity_time: {
                minValue: minValue(1),
                maxValue: maxValue(1000)
            },
            validity_time_unit: {
                timeUnitValid: isTimeUnitValid
            }
        }
    },
    computed: {
        isValid () {
            return !this.$v.$invalid;
        },
        value () {
            return { ...this.form };
        }
    },
    mounted () {
        this.$emit('formUpdated', this.isValid);
github getkirby / kirby / panel / src / components / Forms / Input / NumberInput.vue View on Github external
validations() {
    return {
      value: {
        required: this.required ? required : true,
        min: this.min ? minValue(this.min) : true,
        max: this.max ? maxValue(this.max) : true
      }
    };
  }
}
github DivanteLtd / vue-storefront / src / themes / default / components / core / ProductQuantity.vue View on Github external
validations () {
    return {
      value: {
        minValue: minValue(1),
        maxValue: maxValue(this.max) && !this.isSimpleOrConfigurable,
        numeric,
        required
      }
    }
  },
  watch: {
github getkirby / kirby / panel / src / components / Forms / Input / RangeInput.vue View on Github external
validations() {
    return {
      position: {
        required: this.required ? required : true,
        min: this.min ? minValue(this.min) : true,
        max: this.max ? maxValue(this.max) : true
      }
    };
  }
}