This repository has been archived on 2024-07-22. You can view files and clone it, but cannot push or open issues or pull requests.
Doric/doric-demo/src/FunctionalComponentDemo.tsx

21 lines
560 B
TypeScript
Raw Normal View History

2022-07-04 14:13:41 +08:00
import { Text, Group, Panel, jsx, VLayout, layoutConfig, HLayout } from "doric";
function CellItem(props: { text: string }) {
return (
<HLayout layoutConfig={layoutConfig().mostWidth().justHeight()} height={50}>
<Text>{props.text}</Text>
</HLayout>
);
}
@Entry
class FunctionalComponentDemo extends Panel {
build(root: Group) {
<VLayout layoutConfig={layoutConfig().most()} parent={root}>
<CellItem text="Cell0"></CellItem>
<CellItem text="Cell1"></CellItem>
<CellItem text="Cell2"></CellItem>
</VLayout>;
}
}