A lightweight, Laravel-inspired validation package for Vue 3
npm install @kolirt/vue-validation-kit
A lightweight, Laravel-inspired validation package for Vue 3. Effortlessly validate complex, nested data structures with minimal code.
Table of Contents
- Getting started
- Advantages of using this solution
- 🔥 Key benefits
- 🚀 Features
- Installation
- Setup
- Usage
- Validate field
- Validate object
- Rules
- Presence and requirement
- Value comparison
- Size and range
- Data types
- Special formats
- List membership
- Acceptance state
- Demo
- Example
- Faq
- License
- Other packages
vue-validation-kit is a convenient and powerful package for data validation in Vue.js applications. It provides a simple and intuitive solution for form validation, inspired by the validation system of the Laravel framework, making it particularly user-friendly for developers familiar with this technology. The package allows seamless integration of validation into projects while keeping the code clean and structured.
- Ease of Use
An intuitive syntax, similar to Laravel, enables quick setup of validation rules with minimal effort.
- Flexibility
Supports a wide range of built-in validation rules and offers the ability to create custom rules.
- Efficiency
Significantly reduces the amount of code required to implement validation, making projects easier to maintain.
- Laravel-Inspired
Developers working with Laravel will immediately recognize a familiar validation approach, simplifying the transition between frontend and backend.
With vue-validation-kit, you can focus on your application’s logic rather than tedious validation checks, while benefiting from a reliable and scalable tool for form handling in Vue.js.
Use yarn or npm to install the package @kolirt/vue-validation-kit.
``bash
npm install --save @kolirt/vue-validation-kit
yarn add @kolirt/vue-validation-kit
`
Add dependencies to your main.ts:
`javascript
import { createApp } from 'vue'
import { createValidation } from '@kolirt/vue-validation-kit'
import { en } from '@kolirt/vue-validation-kit/localization'
const app = createApp({ ... })
app.use(createValidation({
locale: 'en',
messages: { en }
}))
app.mount('#app')
`
`vue
{{ firstError }}
`
`vue
{{ firstError }}
{{ firstError }}
`
Check closed issues with FAQ` label to get answers for most asked
questions.
Check out my other projects on my GitHub profile.