https://github.com/ryanve/v-togg
Vue UI toggle behavior directive
https://github.com/ryanve/v-togg
toggle toggles ui ui-directive vue vue-directive
Last synced: 18 days ago
JSON representation
Vue UI toggle behavior directive
- Host: GitHub
- URL: https://github.com/ryanve/v-togg
- Owner: ryanve
- License: mit
- Created: 2017-03-10T01:24:58.000Z (about 9 years ago)
- Default Branch: gh-pages
- Last Pushed: 2017-03-16T02:32:41.000Z (about 9 years ago)
- Last Synced: 2026-05-11T21:07:11.880Z (23 days ago)
- Topics: toggle, toggles, ui, ui-directive, vue, vue-directive
- Language: HTML
- Homepage: https://ryanve.dev/v-togg/
- Size: 4.88 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# v-togg
Vue UI directive. Toggle classes, attributes, properties.
## Usage
[View interactive examples](https://ryanve.github.io/v-togg/)
### 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`](https://www.npmjs.com/package/v-togg)
```
npm install v-togg --save
```
#### `require` the directive
```js
require('v-togg')
```
#### Create `Vue` instance
```js
new Vue({
el: '#your-app'
})
```
## Related
[Also available as an Angular directive](https://ryanve.github.io/togg/)