0.0.8 • Published 8 years ago

javvi v0.0.8

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

javvi

Just Another Vue Validation Idea

Install

npm install --save javvi

Introduction

It is flexible, unobtrusive, lightweight. No need for a form, no need for submit buttons, no scoping tag.

It is as simple as just 3 mixins:

  1. Validatable used on components that display the error messages

    Just give validatable an array of validators. Validators are objects that contains:

    {
      pred: 'A function that applies to model value and return boolean value',
      message: 'The error message when validation fails'
    }

    So you can define custom validators with little effort. Note that the pred function should return true on invalid model value;

  2. ValidationContainer used on the component that triggers the validation

    Call this.$doValidate whenever to trigger validation, it will return a Promise. If all validatables pass, this promise will be resolved, otherwise rejected.

  3. DefaultValidators are just some frequently used validators.

Here is the example

0.0.8

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago