elbo

1.0.0 • Public • Published

elbo

A tiny, friendly HTML custom element boilerplate:

<foo-bar>
  <span class="text">click a button</span>
  <button data-text="hi!">say hi</button>
  <button data-text="bye.">say bye</button>
</foo-bar>
var elbo = require('elbo');
 
elbo.register('foo-bar', {
  methods: {
    say: function(text) {
      this.querySelector('.text').textContent = text;
    }
  },
  events: {
    'click:delegate(button)': function(e) {
      this.say(e.target.getAttribute('data-text'));
    }
  }
});

Readme

Keywords

Package Sidebar

Install

npm i elbo

Weekly Downloads

1

Version

1.0.0

License

CC0-1.0

Last publish

Collaborators

  • shawnbot