1.0.1 • Published 8 years ago

vue-dirtifier v1.0.1

Weekly downloads
3
License
MIT
Repository
-
Last release
8 years ago

vue-dirtifier

Add Angular-ish class names to inputs in various states

Usage

var dirtifier = require('vue-dirtifier')
Vue.use(dirtifier)

// create a root instance
// and tell Vue to start watching inputs
new Vue({
  el: '#app',
  components: { App },
  ready: function () {
    Vue.startDirtyInputWatch()
  }
})

Options

You can set and pass any of the options below as an object like this:

Vue.use(dirtifier, options)

events Decides the event listeners to attach to each input object.

Default: ["input", "change", "keyup", "paste"]

dirtyClassName Decides the class name to add to any input after one of the event triggers.

Default: "dirty"

cleanedClassName Decides the class name to add to any dirty text input that has been cleared.

Default: "cleaned"

checkCleaned Decides whether or not to care about adding options.cleanedClassName.

Default: true