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