Skip to content

ryanve/v-togg

Repository files navigation

v-togg

Vue UI directive. Toggle classes, attributes, properties.

Usage

View interactive examples

Attributes

  • v-togg: vue entry point (must accompany togg-event)
  • togg-event: event(s) to listen to
  • togg-scope: applicable scope
  • togg-class: classes to toggle when event occurs
  • togg-attr: attribute to toggle when event occurs
  • togg-prop: property to toggle when event occurs
  • togg-state: force state true or false from event target
  • togg-trigger additional events to trigger when event occurs
  • togg-method: jQuery method to invoke when event occurs

Setup

npm install v-togg --save

require the directive

require('v-togg')

Create Vue instance

new Vue({
  el: '#your-app'
})

Related

Also available as an Angular directive