Browse Source

增加组件默认populate方法

es6
guy 4 years ago
parent
commit
1ee7637083
  1. 2
      examples/demo.worker.js
  2. 15
      examples/dev.html
  3. 4
      examples/hooks.html
  4. 8
      examples/worker.html
  5. 4
      src/base/single/button/buttons/button.js
  6. 4
      src/base/single/label/abstract.label.js
  7. 4
      src/base/single/single.js

2
demo.worker.js → examples/demo.worker.js

@ -1,5 +1,5 @@
if (this.importScripts) {
importScripts("./dist/fineui_without_jquery_polyfill.js");
importScripts("../dist/fineui_without_jquery_polyfill.js");
BI.initWorker();
}
var Model = BI.inherit(Fix.Model, {

15
dev.html → examples/dev.html

@ -2,7 +2,8 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<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>
@ -37,9 +38,6 @@
BI.model("demo.child_model", ChildModel);
var Child = BI.inherit(BI.Widget, {
props: {
updateMode: "auto"
},
setup: function () {
var store = BI.useStore(function () {
return BI.Models.getModel("demo.child_model");
@ -67,18 +65,25 @@
updateMode: "auto"
},
setup: function () {
var child;
var store = BI.useStore(function () {
return BI.Models.getModel("demo.model");
});
setInterval(function () {
store.toggle();
}, 1000);
BI.watch("text", function () {
child.populate();
});
return function () {
return {
type: "bi.vertical",
vgap: 20,
items: [{
type: "demo.child"
type: "demo.child",
ref: function (_ref) {
child = _ref;
}
}, {
type: "demo.child"
}]

4
hooks.html → examples/hooks.html

@ -2,8 +2,8 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<script src="./dist/fineui.js"></script>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
</head>
<body>
<div id="wrapper"></div>

8
worker.html → examples/worker.html

@ -2,11 +2,9 @@
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui.min.css"/>
<!-- 下面是不包含normalize.css的css -->
<!-- <link rel="stylesheet" type="text/css" href="http://fanruan.design/fineui/2.0/fineui_without_normalize.min.css" /> -->
<script src="./dist/fineui.js"></script>
<script src="./dist/fix/worker.compact.js"></script>
<link rel="stylesheet" type="text/css" href="../dist/2.0/fineui.css"/>
<script src="../dist/2.0/fineui.js"></script>
<script src="../dist/fix/worker.compact.js"></script>
<script src="demo.worker.js"></script>
</head>
<body>

4
src/base/single/button/buttons/button.js

@ -145,10 +145,6 @@ BI.Button = BI.inherit(BI.BasicButton, {
unHighLight: function () {
this.text.unHighLight.apply(this.text, arguments);
},
destroy: function () {
BI.Button.superclass.destroy.apply(this, arguments);
}
});
BI.shortcut("bi.button", BI.Button);

4
src/base/single/label/abstract.label.js

@ -381,10 +381,6 @@
if (!this.isReadOnly()) {
this.text.setValue(v);
}
},
populate: function () {
BI.AbstractLabel.superclass.populate.apply(this, arguments);
}
});
}());

4
src/base/single/single.js

@ -138,10 +138,6 @@ BI.Single = BI.inherit(BI.Widget, {
this._hoverBinded = false;
},
populate: function (items) {
this.items = items || [];
},
// opt: {container: '', belowMouse: false}
setTitle: function (title, opt) {
this.options.title = title;

Loading…
Cancel
Save