OneScript

Section

将内容组织为带页眉和页脚的分组。

Section 提供页眉、主体和页脚三个视图插槽。header 和 footer 支持任意 OneScript 视图、组件或视图数组。

import { HStack, Section, Symbol, Text } from "onescript/views"

<Section
  header={
    <HStack spacing={6}>
      <Symbol name="person.2.fill" />
      <Text>团队</Text>
    </HStack>
  }
  footer={<Text>共 2 人</Text>}
>
  <Text>Alice</Text>
  <Text>Bob</Text>
</Section>
PropType说明
headerViewChild可选页眉。
footerViewChild可选页脚。
childrenViewChild分组主体内容。

在 LazyVStack、LazyHStack、LazyVGrid 或 LazyHGrid 中配合 pinnedViews,可以让页眉或页脚在滚动过程中保持吸附。

How is this guide?

最后更新于