gremlins-jquery

2.0.0-beta3 • Public • Published

gremlins-jquery

GREMLIN.JS jQuery mixin that supports event and element maps.

Installation

requires gremlins@1.1.x

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!');
    }
});

Readme

Keywords

none

Package Sidebar

Install

npm i gremlins-jquery

Weekly Downloads

1

Version

2.0.0-beta3

License

MIT

Last publish

Collaborators

  • grmlin