kazupon / vue-validator

:white_check_mark: Validator component for Vue.js
MIT License
2.19k stars 431 forks source link

Suggest validator-scope intial, detect-change, detect-blur #230

Closed tremendus closed 8 years ago

tremendus commented 8 years ago

With regards to the three field-scoped attributes above, suggest enabling a validator scoped attribute. In my experience it is common to want all validation on all inputs to behave the same way. currently a form with 20 fields requires setting these three properties on each field. prefer if it could be done once in the validator scope and then, where necessary, provide an override at the field level.

(Examples written in jade/pug)

validator(name='form1', detect-change='off', detect-blur='off')
  input.form-control(type='text', v-model='req', v-validate:req='["required"]', detect-blur='on')
kazupon commented 8 years ago

Thank you for your feedback! I'll try to plan improvement about validation timing or behave. 😺

kazupon commented 8 years ago

I'll try to improve at 3.0

kazupon commented 8 years ago

released v3.0.0-alpha.1 https://github.com/vuejs/vue-validator/releases/tag/v3.0.0-alpha.1

In 3.0 later, validation is default manually. we can use validation with event handling (blur/focusout, focus/focusin, etc) and any timing.