# v2-check

> form validate plugin

Latest version **1.0.6** (published 2019-09-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install v2-check
pnpm add v2-check
yarn add v2-check
bun add v2-check
```

## 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.6 |
| Published | 2019-09-26 |
| First published | 2019-09-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 27.2 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Andraw lin |
| Maintainers | andraw-lin |
| Keywords | vuejs, javascript, validate, form |

## Links

- npm: https://www.npmjs.com/package/v2-check
- npm.io page: https://npm.io/package/v2-check

## Dependencies (1)

- [vue](https://npm.io/package/vue.md) ^2.5.11

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 1.0.6 (latest) — 2019-09-26
- 1.0.5 — 2019-09-25
- 1.0.4 — 2019-09-25
- 1.0.3 — 2019-09-25
- 1.0.2 — 2019-09-25
- 1.0.1 — 2019-09-25
- 1.0.0 — 2019-09-02

## README

# v2-check
[![npm](https://img.shields.io/npm/v/npm)](https://img.shields.io/npm/v/npm)&nbsp;[![MIT](https://img.shields.io/github/license/Andraw-lin/v2-check)](https://img.shields.io/github/license/Andraw-lin/v2-check)

A component form validation plugin in Vue 2.0. [github](https://github.com/Andraw-lin/v2-check)

## Install

You can install the package via npm:

```bash
$ npm install -s v2-check
```

Otherwise, you can just get `v2-check.js` into your code.

## Usage

Import `v2-check` before initializing Vue.

```javascript
import Vue from 'vue'
import v2Check from 'v2-check'

Vue.use(v2Check)
```

Then you can use the `check-item` and the `check-all`  directive on your component. Ex:

```javascript
<template>
  <section class="form-container" v-check-all="initFormData.uuid">
    <div>
      Text option:
      <input type="text" :class="{'error-input': $getFormItemMessage(initFormData.uuid, initFormData.textOption.name)}" v-check-item="initFormData.textOption" v-model="initFormData.textOption.value" />
      <span class="error-msg" v-show="initFormStatus">{{ $getFormItemMessage(initFormData.uuid, initFormData.textOption.name) }}</span>
    </div>
  </section>
</template>

<script>
export default {
  data () {
    return {
      initFormStatus: null,
      initFormData: {
        uuid: new Date().toString(),
        textOption: {
          name: 'textOption',
          value: '',
          validate: [
            {rule: /^.{1,}$/, message: 'This field is required'}
          ]
        }
      }
    }
  },
  mounted () {
    this.initFormStatus = this.$formStatus
  }
}
</script>
```

Awesome, you can also see this demo on [JSFiddle](https://jsfiddle.net/Andraw_lin/eoxndqjg/62/).

## License

The MIT License (MIT). Please see [License File](https://github.com/Andraw-lin/v2-check/blob/master/LICENSE) for more information.

## Suggestion

`v2-check` Still in the process of continuous improvement, if you have any problems during the development process, I welcome you to submit it in the issue.

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