For AI agents: the complete documentation index is available at /ooui-react/llms.txt, the full documentation bundle is available at /ooui-react/llms-full.txt, and this page is available as Markdown at /ooui-react/components/page-layout/index.md.
  • 中文
  • PageLayout 页面布局

    源代码 | 原版组件

    分页面板:StackLayout 的 options 数组项。一般不直接渲染,把它写进 StackLayout 的 options 即可。

    单独使用

    单独使用时,激活态由 active 声明;未声明 active 时按「非 hidden 即激活」派生,并输出 oo-ui-pageLayout-active 类。label / value 是随页签集对象透入的字段,组件会吞掉、不落成 DOM 属性。

    第一页内容
    import { PageLayout, StackLayout } from "ooui-react";
    
    function App() {
      return (
        <StackLayout
          value="a"
          options={[
            { value: "a", label: "第一页", padded: true, children: "第一页内容" },
            { value: "b", label: "第二页", padded: true, children: "第二页内容" },
          ]}
        />
      );
    }
    
    export default App;

    API

    继承 PanelLayout 全部属性,另有:

    属性描述类型默认值
    active是否为激活页;缺省时由 hidden 派生(非 hidden 即激活)boolean由 hidden 派生
    scrollable是否可滚动(分页缺省可滚)booleantrue
    label / value随页签集对象透入,仅供组件吞掉ReactNode / string | number—

    另见