semisleep / simple-vue-validator

A simple yet flexible validator library for vue.js
MIT License
293 stars 28 forks source link

Improve mixin documentation #44

Open crickford opened 6 years ago

crickford commented 6 years ago

When using the mixin (as documented here), there is no apparent way to set the interaction mode. It seems the entire plugin have to be imported first, so that the plugin method setMode can be called before the mixin is used - perhaps this should be documented?

Example:

import SimpleVueValidator from 'simple-vue-validator'
SimpleVueValidator.setMode('conservative')
const Validator = SimpleVueValidator.Validator
export default {
  name: 'MyComponent',
  mixins: [SimpleVueValidator.mixin],

...