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'));
}
}
});
Package Sidebar
Install
Weekly Downloads