JSFiddle - React, Tailwind, and code Playground
by fstarred
HTML
<script id="template" type="text/ractive">
<span decorator="test:{{ { namebind: demo } }}">{{demo}}</span>
<button on-click="toggle('demo')">Toggle value</button>
</script>
JavaScript
var testDecorator = function ( node, options ) {
return {
teardown: function () {
},
update: function (value) {
this.fire('myEvent', value);
}
}
};
Ractive.decorators.test = testDecorator;
ractive = new Ractive({
el: 'body',
template: '#template',
data:
{
demo: false
}
});
ractive.on('myEvent', function(event)
{
});