vue-otto-validate
    TypeScript icon, indicating that this package has built-in type declarations

    1.0.3 • Public • Published

    vue-otto-validate

    Build Status Total alerts Language grade: JavaScript Npm Version npm: total downloads Types Dep license

    Install

    $ yarn add vue-otto-validate

    Usage

    import it , use as plugin , show errors when http response errors.

    import Validator,{showErrors} from "vue-otto-validate"
    Vue.use(Validator,{className:"text-danger"})
    axios.post(...).catch(r => {showErrors( r.response.data.errors)});
    // errors object : {fieldName:["message1","message2"...],...}
    // if you using rails you already known

    add directive v-validate="{leftOffset:100,topOffset:8}" among with v-model to element.

    only need one attribute format as below
    v-validate:position.className1.className2=optionsObj

    preview:

    preview

    results html:

    html

    options

    Option Type Default Description
    responsive Boolean false tip responsive to field ?
    translate String "3d" "3d" or "2d" responsive using "translate3d" or translate 2d
    position String "leftTop" currently only supports "leftTop"
    leftOffset Number 0 left offset relative to field's left
    topOffset Number 0 top offset above field

    dist

    $ yarn dist

    start and watch

    $ yarn start

    Install

    npm i vue-otto-validate

    DownloadsWeekly Downloads

    0

    Version

    1.0.3

    License

    MIT

    Unpacked Size

    41.8 kB

    Total Files

    10

    Last publish

    Collaborators

    • bung87