How to use the vuelidate/lib/validators/minLength 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 vuefront / vuefront / src / components / elements / account / register.vue View on Github external
required,
        minLength: minLength(1),
        maxLength: maxLength(32)
      },
      email: {
        required,
        email
      },
      password: {
        required,
        minLength: minLength(4),
        maxLength: maxLength(20)
      },
      confirmPassword: {
        required,
        minLength: minLength(4),
        maxLength: maxLength(20),
        sameAsPassword: sameAs("password")
      }
    }
  },
  computed: {
    ...mapGetters({
      error: "vuefront/error"
    })
  },
  methods: {
    async onSubmit() {
      this.$v.$touch();

      if (!this.$v.form.$invalid) {
        await this.$store.dispatch("common/customer/register", {
github vuefront / vuefront / src / components / elements / common / reviews.vue View on Github external
},
  mixins: [validationMixin],
  validations: {
    rating: {
      required,
      minValue: minValue(1),
      maxValue: maxValue(5),
    },
    author: {
      required,
      minLength: minLength(1),
      maxLength: maxLength(32),
    },
    review: {
      required,
      minLength: minLength(25),
      maxLength: maxLength(1000),
    },
  },
  methods: {
    handleSend() {
      this.$v.$touch()

      if (!this.$v.$invalid) {
        this.$emit('create', {
          content: this.review,
          author: this.author,
          rating: this.rating,
        })
        this.author = ''
        this.rating = 0
        this.review = ''
github vuefront / vuefront / lib / components / organisms / review-form / review-form.vue View on Github external
},
  mixins: [validationMixin],
  validations: {
    rating: {
      required,
      minValue: minValue(1),
      maxValue: maxValue(5)
    },
    author: {
      required,
      minLength: minLength(1),
      maxLength: maxLength(32)
    },
    review: {
      required,
      minLength: minLength(25),
      maxLength: maxLength(1000)
    }
  },
  methods: {
    onSubmit(e) {
      this.$v.$touch();

      if (!this.$v.$invalid) {
        this.$emit("submit", {
          content: this.review,
          author: this.author,
          rating: this.rating
        });
        this.author = "";
        this.rating = 0;
        this.review = "";
github vuefront / vuefront / src / components / elements / account / createAddress.vue View on Github external
...fields,
        zoneId: {
          required
        }
      };
    }
    return {
      form: {
        firstName: {
          required,
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        lastName: {
          required,
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        company: {
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        address1: {
          required,
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        address2: {
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        city: {
github vuefront / vuefront / src / components / elements / account / editAddress.vue View on Github external
}

    return {
      form: {
        firstName: {
          required,
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        lastName: {
          required,
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        company: {
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        address1: {
          required,
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        address2: {
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        city: {
          required,
          minLength: minLength(2),
          maxLength: maxLength(128)
        },
github vuefront / vuefront / src / components / elements / account / createAddress.vue View on Github external
lastName: {
          required,
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        company: {
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        address1: {
          required,
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        address2: {
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        city: {
          required,
          minLength: minLength(2),
          maxLength: maxLength(128)
        },
        zipcode: {
          required,
          minLength: minLength(2),
          maxLength: maxLength(10)
        },
        countryId: {
          required
        },
        ...fields
github vuefront / vuefront / src / components / elements / account / edit.vue View on Github external
data() {
    const customer_info = this.$store.getters["common/customer/get"];
    return {
      form: {
        firstName: customer_info.firstName,
        lastName: customer_info.lastName,
        email: customer_info.email
      }
    };
  },
  mixins: [validationMixin],
  validations: {
    form: {
      firstName: {
        required,
        minLength: minLength(1),
        maxLength: maxLength(32)
      },
      lastName: {
        required,
        minLength: minLength(1),
        maxLength: maxLength(32)
      },
      email: {
        required,
        email
      }
    }
  },
  computed: {
    ...mapGetters({
      error: "vuefront/error"
github vuefront / vuefront / lib / components / organisms / address-create-form / address-create-form.vue View on Github external
...fields,
        zoneId: {
          required
        }
      };
    }
    return {
      form: {
        firstName: {
          required,
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        lastName: {
          required,
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        company: {
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        address1: {
          required,
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        address2: {
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        city: {
github vuefront / vuefront / lib / components / organisms / address-create-form / address-create-form.vue View on Github external
company: {
          minLength: minLength(1),
          maxLength: maxLength(32)
        },
        address1: {
          required,
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        address2: {
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        city: {
          required,
          minLength: minLength(2),
          maxLength: maxLength(128)
        },
        zipcode: {
          required,
          minLength: minLength(2),
          maxLength: maxLength(10)
        },
        countryId: {
          required
        },
        ...fields
      }
    };
  },
  methods: {
github vuefront / vuefront / src / components / templates / account / editAddress / editAddress.vue View on Github external
},
        address2: {
          minLength: minLength(3),
          maxLength: maxLength(128)
        },
        city: {
          required,
          minLength: minLength(2),
          maxLength: maxLength(128)
        },
        countryId: {
          required
        },
        zipcode: {
          required,
          minLength: minLength(2),
          maxLength: maxLength(10)
        },
        ...fields
      }
    };
  },
  computed: {