forked from fanruan/fineui
Browse Source
* commit '598e6529c2a5eb217be1d65cdf48a087a3bb3c67': (44 commits) auto upgrade version to 2.0.20210821090116 整理代码 路由 auto upgrade version to 2.0.20210820185216 整理代码 整理代码 整理代码 auto upgrade version to 2.0.20210820175128 下个版本再改 auto upgrade version to 2.0.20210819233200 整理代码 整理代码 整理代码 auto upgrade version to 2.0.20210819231136 整理代码 整理代码 整理代码 inline布局可以用在virtualgroup中 auto upgrade version to 2.0.20210819205125 整理代码 ...es6
Guyi
3 years ago
101 changed files with 2258 additions and 3212 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Binary file not shown.
Before Width: | Height: | Size: 414 KiB After Width: | Height: | Size: 416 KiB |
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -0,0 +1,142 @@
|
||||
<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> |
||||
BI.config("demo.parent", function (config){ |
||||
console.log("123"); |
||||
return config; |
||||
}, { |
||||
version: "1.0" |
||||
}); |
||||
|
||||
BI.module("my.module", { |
||||
// version不设置的话默认就用接口的version作为判断条件 |
||||
version: "1.0", |
||||
components: { |
||||
"demo.parent": "1.0" |
||||
} |
||||
}) |
||||
|
||||
// 主线代码里加这个 |
||||
BI.config("bi.provider.system", function (provider) { |
||||
provider.addDependencies({ |
||||
"my.module": { |
||||
minVersion: "2.0", |
||||
maxVersion: "4.0" |
||||
} |
||||
}) |
||||
}) |
||||
</script> |
||||
<script> |
||||
var Model = BI.inherit(Fix.Model, { |
||||
state: function () { |
||||
return { |
||||
expand: false |
||||
}; |
||||
}, |
||||
childContext: ["text"], |
||||
|
||||
computed: { |
||||
text: function () { |
||||
return this.model.expand ? "text-yes" : "text-not"; |
||||
} |
||||
}, |
||||
|
||||
actions: { |
||||
toggle: function () { |
||||
this.model.expand = !this.model.expand; |
||||
} |
||||
} |
||||
}); |
||||
|
||||
BI.model("demo.model", Model); |
||||
var ChildModel = BI.inherit(Fix.Model, { |
||||
context: ["text"] |
||||
}); |
||||
|
||||
BI.model("demo.child_model", ChildModel); |
||||
|
||||
var Child = BI.inherit(BI.Widget, { |
||||
setup: function () { |
||||
var store = BI.useStore(function () { |
||||
return BI.Models.getModel("demo.child_model"); |
||||
}); |
||||
return { |
||||
render: function () { |
||||
return { |
||||
type: "bi.vertical", |
||||
items: [{ |
||||
type: "bi.button", |
||||
text: store.model.text, |
||||
handler: function () { |
||||
console.log("click"); |
||||
} |
||||
}, { |
||||
type: "bi.label", |
||||
text: store.model.text |
||||
}] |
||||
}; |
||||
} |
||||
}; |
||||
} |
||||
}); |
||||
BI.shortcut("demo.child", Child); |
||||
|
||||
var Widget = BI.inherit(BI.Widget, { |
||||
props: { |
||||
vdom: true |
||||
}, |
||||
watch: { |
||||
text: function () { |
||||
this.reset(); |
||||
} |
||||
}, |
||||
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.reset(); |
||||
// }); |
||||
return function () { |
||||
return { |
||||
type: "bi.vertical", |
||||
vgap: store.model.expand ? 20 : 30, |
||||
items: [{ |
||||
type: "demo.child", |
||||
ref: function (_ref) { |
||||
child = _ref; |
||||
} |
||||
}, { |
||||
type: "demo.child" |
||||
}] |
||||
}; |
||||
}; |
||||
} |
||||
}); |
||||
BI.shortcut("demo.parent", Widget); |
||||
BI.createWidget({ |
||||
type: "bi.absolute", |
||||
items: [{ |
||||
el: { |
||||
type: "demo.parent" |
||||
}, |
||||
top: 100, |
||||
left: 100 |
||||
}], |
||||
element: "#wrapper" |
||||
}); |
||||
</script> |
||||
</body> |
||||
</html> |
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in new issue