tsx:support array in children

This commit is contained in:
pengfei.zhou
2021-09-02 14:31:24 +08:00
committed by osborn
parent 03633a7bea
commit 266d20782a
8 changed files with 100 additions and 39 deletions

View File

@@ -21,7 +21,7 @@ function createFragment() {
@Entry
class Counter extends Panel {
build(root: Group) {
const fragmnets = createFragment();
const fragments = createFragment();
const ref = makeRef<Text>();
let count = 0;
<VLayout
@@ -42,7 +42,13 @@ class Counter extends Panel {
ref.current.text = `${count}`;
}}
/>
{fragmnets}
{fragments}
{[0, 1, 2, 3].map((i) => (
<>
<Text text={`Index ${i}`} />
<Text text={`Subtitle ${i}`} textSize={10} />
</>
))}
</VLayout>;
}
}