gremlins-jquery
v2.0.0-beta3
Published
gremlins-jquery ================
Downloads
19
Readme
gremlins-jquery
GREMLIN.JS jQuery mixin that supports event and element maps.
Installation
requires [email protected]
NPM
$ npm install gremlins-jquery
make sure you have jQuery installed from npm, too.
Usage
<foo-gremlin>
<p class="content"></p>
<button>clicker</button>
</foo-gremlin>
const gremlins = require('gremlins');
const gremlinsJquery = require('gremlins-jquery');
gremlins.create('foo-gremlin', {
mixins: [gremlinsJquery],
elements: {
'.content': '$content'
},
events: {
'click button': 'onClick'
},
created() {
this.$el.addClass('ready');
},
onClick() {
this.$content.text('foo is here!');
}
});