forked from fanruan/fineui
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
1.5 KiB
58 lines
1.5 KiB
<html> |
|
<head> |
|
<meta charset="utf-8"> |
|
<title></title> |
|
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/> |
|
<!-- <script src="../dist/2.0/fineui.js"></script>--> |
|
<script src="http://localhost:9001/fineui.js"></script> |
|
</head> |
|
<body> |
|
<div id="wrapper"></div> |
|
<script> |
|
var Model = BI.inherit(Fix.Model, { |
|
state: function () { |
|
return { |
|
count: 0 |
|
}; |
|
} |
|
}); |
|
|
|
BI.model("demo.model", Model); |
|
|
|
var Widget = BI.inherit(BI.Widget, { |
|
_store: function () { |
|
return BI.Models.getModel("demo.model"); |
|
}, |
|
setup: function () { |
|
var store = BI.useStore(); |
|
return function () { |
|
return { |
|
type: "bi.vertical", |
|
items: [{ |
|
type: "bi.button", |
|
effect: function () { |
|
this.setText(store.model.count) |
|
}, |
|
handler: function () { |
|
store.model.count++; |
|
} |
|
}] |
|
}; |
|
}; |
|
} |
|
}); |
|
BI.shortcut("demo.hooks", Widget); |
|
BI.createWidget({ |
|
type: "bi.absolute", |
|
items: [{ |
|
el: { |
|
type: "demo.hooks" |
|
}, |
|
top: 100, |
|
left: 100 |
|
}], |
|
element: "#wrapper" |
|
}); |
|
</script> |
|
</body> |
|
</html>
|
|
|