DOM helpers plugin for Vue.js
npm | yarn | bower | jsDelivr |
---|---|---|---|
npm install vue-gaspard | yarn add vue-gaspard | bower install vue-gaspard | vue-gaspard.umd.js |
In main.js:
import Vue from 'vue'
import VueGaspard from 'vue-gaspard'
Vue.use(VueGaspard)
In any of your components:
import Vue from 'vue'
export default {
mounted () {
// Use gaspard global
Vue.$gaspard.addClass(document.documentElement, 'container')
// Or on this component instance
this.$g.css('border', '1px dashed #eb592d')
}
}
You can optionally pass in some options:
Name | Type | Default | Description |
---|---|---|---|
globalNamespace | String | $gaspard | Global access name |
instanceNamespace | String | $g | Instance access name |
Override defaults example:
Vue.use(VueGaspard, {
globalNamespace: '$dom',
instanceNamespace: '$dom'
})
# Install dependencies
cd vue-gaspard
npm install
# Build main library
npm run build
# Run demo
npm run dev
MIT License Copyright (c) 2017 Luca Perret