0.1.5 • Published 2 years ago

@vue-formily/rules v0.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

Validation rules for vue-formily.

Links

Installation

CDN

You can use validation rules with a script tag and a CDN, import the library like this:

<script src="https://unpkg.com/@vue-formily/rules@latest"></script>

This will inject a Rules global object, which you will use to access the various rules.

If you are using native ES Modules, there is also an ES Modules compatible build:

<script type="module">
  import rules from 'https://unpkg.com/@vue-formily/rules@latest/dist/rules.esm.js'
</script>

NPM

# install with yarn
yarn add @vue-formily/rules

# install with npm
npm install @vue-formily/rules --save

Basic Usage

import { required, email } from '@vue-formily/rules';

const formSchema = {
  formId: 'login',
  fields: [
    {
      formId: 'email',
      rules: [
        required,
        email
      ]
    },
  ]
};

// Use the schema in Vue instance
// ...

Contributing

You are welcome to contribute to this project, but before you do, please make sure you read the Contributing Guide.

License

MIT

0.1.2

2 years ago

0.1.4

2 years ago

0.1.3

2 years ago

0.1.5

2 years ago

0.1.1

3 years ago

0.1.0

3 years ago