vuelidate

WebJar for vuelidate

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

vuelidate
Последняя версия

Последняя версия

0.7.6
Дата

Дата

Тип

Тип

jar
Описание

Описание

vuelidate
WebJar for vuelidate
Ссылка на сайт

Ссылка на сайт

https://www.webjars.org
Система контроля версий

Система контроля версий

https://github.com/vuelidate/vuelidate

Скачать vuelidate

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/vuelidate/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>vuelidate</artifactId>
    <version>0.7.6</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/vuelidate/
implementation 'org.webjars.npm:vuelidate:0.7.6'
// https://jarcasting.com/artifacts/org.webjars.npm/vuelidate/
implementation ("org.webjars.npm:vuelidate:0.7.6")
'org.webjars.npm:vuelidate:jar:0.7.6'
<dependency org="org.webjars.npm" name="vuelidate" rev="0.7.6">
  <artifact name="vuelidate" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='vuelidate', version='0.7.6')
)
libraryDependencies += "org.webjars.npm" % "vuelidate" % "0.7.6"
[org.webjars.npm/vuelidate "0.7.6"]

Зависимости

Библиотека не имеет зависимостей. Это самодостаточное приложение, которое не зависит ни от каких других библиотек.

Модули Проекта

Данный проект не имеет модулей.

vuelidate

codecov gzip size

Simple, lightweight model-based validation for Vue.js

Sponsors

Gold

Storyblok

Silver

Storyblok

Bronze

Vue Mastery logo Vue Mastery logo

Features & characteristics:

  • Model based
  • Decoupled from templates
  • Dependency free, minimalistic library
  • Support for collection validations
  • Support for nested models
  • Contextified validators
  • Easy to use with custom validators (e.g. Moment.js)
  • Support for function composition
  • Validates different data sources: Vuex getters, computed values, etc.

Demo & docs

https://vuelidate.js.org/

Installation

npm install vuelidate --save

You can import the library and use as a Vue plugin to enable the functionality globally on all components containing validation configuration.

import Vue from 'vue'
import Vuelidate from 'vuelidate'
Vue.use(Vuelidate)

Alternatively it is possible to import a mixin directly to components in which it will be used.

import { validationMixin } from 'vuelidate'

var Component = Vue.extend({
  mixins: [validationMixin],
  validations: { ... }
})

The browser-ready bundle is also provided in the package.

<script src="vuelidate/dist/vuelidate.min.js"></script>
<!-- The builtin validators is added by adding the following line. -->
<script src="vuelidate/dist/validators.min.js"></script>
Vue.use(window.vuelidate.default)

Basic usage

For each value you want to validate, you have to create a key inside validations options. You can specify when input becomes dirty by using appropriate event on your input box.

import { required, minLength, between } from 'vuelidate/lib/validators'

export default {
  data () {
    return {
      name: '',
      age: 0
    }
  },
  validations: {
    name: {
      required,
      minLength: minLength(4)
    },
    age: {
      between: between(20, 30)
    }
  }
}

This will result in a validation object:

$v: {
  name: {
    "required": false,
    "minLength": false,
    "$invalid": true,
    "$dirty": false,
    "$error": false,
    "$pending": false
  },
  age: {
    "between": false
    "$invalid": true,
    "$dirty": false,
    "$error": false,
    "$pending": false
  }
}

Checkout the docs for more examples: https://vuelidate.js.org/

Contributing

# install dependencies
npm install

# serve with hot reload at localhost:8080
npm run dev

# create UMD bundle.
npm run build

# Create docs inside /gh-pages ready to be published
npm run docs

# run unit tests
npm run unit

# run all tests
npm test

For detailed explanation on how things work, checkout the guide and docs for vue-loader.

Contributors

Current

Damian Dulisz
Damian Dulisz
Natalia Tepluhina
Natalia Tepluhina
Natalia Tepluhina
Dobromir Hristov
Marina Mosti
Marina Mosti

Emeriti

Here we honor past contributors who have been a major part on this project.

License

MIT

org.webjars.npm

Vuelidate

Версии библиотеки

Версия
0.7.6
0.5.0
0.3.1