# vue-validate-ylli_b

> Simple Vue.js form validation library

Latest version **1.0.0** (published 2020-03-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install vue-validate-ylli_b
pnpm add vue-validate-ylli_b
yarn add vue-validate-ylli_b
bun add vue-validate-ylli_b
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2020-03-01 |
| First published | 2020-03-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 698.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Ylli Gorce |
| Maintainers | ylligorce |

## Links

- npm: https://www.npmjs.com/package/vue-validate-ylli_b
- Repository: https://github.com/ylligorce/vue-validate-ylli
- Homepage: https://github.com/ylligorce/vue-validate-ylli#readme
- Issues: https://github.com/ylligorce/vue-validate-ylli/issues
- npm.io page: https://npm.io/package/vue-validate-ylli_b

## Recent versions

- 1.0.0 (latest) — 2020-03-01
- 0.1.0 — 2020-03-01

## README

# vue-validate-ylli

## Installation

```bash
npm install vue-validate-ylli --save
```

Import the library and use as a Vue plugin

```javascript
import Vue from 'vue'
import VueValidateYlli from 'vue-validate-ylli'
Vue.use(VueValidateYlli)
```

## Basic usage

```javascript
<script>
new Vue({
	data () {
             return {
                text: '',
                email: ''
             }
	},
	validations: {  
             text: {  
                required: true,   
                minLength: 3,
                validate: (value) => value === '123'
             },
            email: {
                required: true,
                email: true,
            }
     },
    methods: {
             submit () {
                 if (this.$validate.isValid()) {
                     //Your logic ...
                 }
             }
	 }
})
</script>
<template>
    <input type='text' v-model='text' />
    <div v-if="$validate.hasError('text')">
        <span v-if="$validate.hasError('text').required"> 
                {{$validate.hasError('text').required.message}}
        </span>	    
        <span v-if="$validate.hasError('text').minLength">
                Must have 3 characters
        </span>
        <span v-if="$validate.hasError('text').validate">
            Value must be '123'
        </span>
    </div>
</template>

```
## Rules

 - required
> 	Boolean true | false
 - email
> 	Boolean true | false
 - minLength
> 	Number
 - validate
> 	Function (value) => return boolean (true | false) based on a condition

---
_Source: https://npm.io/package/vue-validate-ylli_b · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
