JSFiddle - React, Tailwind, and code Playground
by enyojs
JavaScript
enyo.kind({
name: "SampleApp",
kind: "enyo.Application",
controllers: [
{ name: "sampleController", kind: "SampleController", model: new enyo.Model({myValue:"Initial Value"}) }
],
view: "SampleView"
});
enyo.kind({
name: "SampleView",
controller: ".app.sampleController",
bindings: [
{from:".controller.myValue", to:".$.toolbar.content"}
],
components: [
{kind: "onyx.Toolbar", content: "Your sample here"},
{kind: "onyx.InputDecorator", components: [
{kind: "onyx.Input", value:"New Value"}
]},
{kind: "onyx.Button", content: "Change Me!", ontap:"tapped"}
],
tapped: function() {
this.controller.changeMyValue(this.$.input.getValue());
}
});
enyo.kind({
name: "SampleController",
kind: "enyo.ModelController",
changeMyValue: function(val) {
this.set("myValue", val);
}
});
enyo.ready(function() {
new SampleApp();
});