Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

vue-high-validator

akbarjodi42MIT1.0.9

A Vue 3 plugin for form validation with Persian-specific validators like Jalali date, national code, etc.

vue, validation, form, persian, jalali, national code

readme

Vue High Validator

A Vue 3 plugin for form validation with Persian-specific validators like required, required_if,integer,nullable, email, Jalali date, national code, etc.

Installation

Features

  • 🌟 Simple: Intuitive and straightforward declarative validation
  • 🧘‍♀️ Versatile: Supports synchronous, asynchronous, field-level, or form-level validation
  • ⚡️ Speedy: Create forms quickly with a lightweight and easy-to-use API
  • 🎯 Lightweight: Focuses only on complex form logic, giving you full control over the rest
npm install vue-high-validator
<script setup>
import { useValidator, useForm, validators } from 'vue-high-validator';

const form = useForm({
  name: '',
  email: '',
});

const { hasValid } = useValidator(form.value, {
  name: 'required',
  email: 'required|email',
});

if (hasValid()) {
  console.log('Form is valid!');
}
</script>
<template>
  <div>
    <input v-model="form.name.value" />
    <span v-if="form.name.hasInvalid">{{ form.name.errorMessage }}</span>
  </div>
</template>