基本佈局
FlexLayout + FlexLayoutContainer 的最基本組成規則。
基本結構
FlexLayoutContainer是一個具有單一方向(行/列)的分割佈局,子元素由 彈性佈局容器組成。如果是 Fragment,則會扁平化並重新處理,但盡量將實際面板單位始終設置為擁有 containerName 的容器會更安全。
tsx
<FlexLayout layoutName="workspace" direction="row">
<FlexLayoutContainer containerName="workspace-left" isResizePanel>
<LeftPanel />
</FlexLayoutContainer>
<FlexLayoutContainer containerName="workspace-main">
<MainPanel />
</FlexLayoutContainer>
</FlexLayout>layoutName / containerName 規則
layoutName
레이아웃 단위의 고유 이름입니다. resize memory, container ref store, split screen store가 이 이름을 기준으로 묶입니다.
containerName
각 패널의 고유 이름입니다. open/close, double click, size observe, drag/drop target 식별에 사용됩니다.
direction
row는 좌우 분할, column은 상하 분할입니다.
嵌套佈局
如果想在一個畫面中將左右分割內再放入上下分割,請在容器內部放入其他 FlexLayoutContainer。每個佈局的 layoutName必須不同,以避免存儲衝突。
tsx
<FlexLayout layoutName="root" direction="row">
<FlexLayoutContainer containerName="root-nav" isResizePanel>
<Navigation />
</FlexLayoutContainer>
<FlexLayoutContainer containerName="root-content">
<FlexLayout layoutName="content" direction="column">
<FlexLayoutContainer containerName="content-editor" isResizePanel>
<Editor />
</FlexLayoutContainer>
<FlexLayoutContainer containerName="content-console">
<Console />
</FlexLayoutContainer>
</FlexLayout>
</FlexLayoutContainer>
</FlexLayout>