# vuelidate-caption

> A component that displays validation errors, built for Vuelidate

Latest version **0.1.8** (published 2020-09-05) · GPL-3.0 license · 0 weekly downloads

## Install

```sh
npm install vuelidate-caption
pnpm add vuelidate-caption
yarn add vuelidate-caption
bun add vuelidate-caption
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.8 |
| Published | 2020-09-05 |
| First published | 2020-08-06 |
| Weekly downloads | 0 |
| License | GPL-3.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 69.3 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | David Meszaroș |
| Maintainers | davidmszrs |
| Keywords | vue, vuelidate, validation |

## Links

- npm: https://www.npmjs.com/package/vuelidate-caption
- Repository: https://github.com/davidmszrs/vuelidate-caption
- Homepage: https://github.com/davidmszrs/vuelidate-caption#readme
- Issues: https://github.com/davidmszrs/vuelidate-caption/issues
- npm.io page: https://npm.io/package/vuelidate-caption

## Dependencies (1)

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

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.1.8 (latest) — 2020-09-05
- 0.1.7 — 2020-08-29
- 0.1.6 — 2020-08-29
- 0.1.5 — 2020-08-06

## README

# vuelidate-caption

### Description
A component that displays validation errors, built for Vuelidate

## Project setup
```
npm install vuelidate-caption
```
## Import the component
```javascript
import VuelidateCaption from 'vuelidate-caption'

export default {
    components: {
        VuelidateCaption
    }
}
```

### Usage

```Vue
<template>
    <div>
        <input type="text" v-model="$v.example.$model">
        <VuelidateCaption :model="$v.example" :validationMessages="validationMessages">
    </div>
</template>

import VuelidateCaption from 'vuelidate-caption'
import { required } from 'vuelidate/lib/validators'

export default {
    components: {
        VuelidateCaption
    },

    validations: {
        example: { required }
    },

    computed: {
        validationMessages: () => {
            required: 'Required value'
        }
    }

    data: () => {
        example: ''
    }
}
```

Whenever $error is triggered on the Vuelidate Model (```model``` prop), the corresponding validation message from ```validationMessages``` will be rendered.

### Props

Prop | Description | Default
------------ | ------------- | -------------
```model``` | The corresponding Vuelidate Model, which contains ```$error```, ```$invalid```, ```$dirty``` properties | Empty object (```() => {}```)
```validationMessages``` | An object that contains the validation messages (eg. ```{ validation-name: 'Validation message'}```) | Empty object (```() => {}```)
```textClass``` | String to be applied to the rendered component's ```class``` attribute | Empty String (```''```)

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