feat:rename collcetion to flowlayout

This commit is contained in:
pengfei.zhou
2019-11-28 15:25:34 +08:00
parent f2b4ba23c4
commit 0031d7a17d
9 changed files with 61 additions and 48 deletions

View File

@@ -13,5 +13,5 @@ export default [
'src/NavigatorDemo',
'src/NavbarDemo',
'src/RefreshableDemo',
'src/CollectionDemo',
'src/FlowLayoutDemo',
]

View File

@@ -1,4 +1,4 @@
import { Group, Panel, collection, layoutConfig, CollectionItem, } from "doric";
import { Group, Panel, flowlayout, layoutConfig, FlowLayoutItem } from "doric";
import { colors, label } from "./utils";
const imageUrls = [
@@ -13,16 +13,16 @@ const imageUrls = [
'https://misc.aotu.io/ONE-SUNDAY/SteamEngine.png',
]
@Entry
class CollectionDemo extends Panel {
class FlowDemo extends Panel {
build(rootView: Group): void {
collection({
flowlayout({
layoutConfig: layoutConfig().atmost(),
itemCount: 50,
itemCount: 500,
renderItem: (idx) => {
return new CollectionItem().apply({
return new FlowLayoutItem().apply({
bgColor: colors[idx % colors.length],
width: 70 + idx,
height: 70 + idx,
width: 200,
height: 50 + idx * 10,
})
},
})