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
2022-07-04 14:21:32 +08:00

21 lines
560 B
TypeScript

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>;
}
}