Loading...
Loading...
Compare original and translation side by side
<PaneDirective><PanesDirective>npm install @syncfusion/ej2-react-layouts --save<PanesDirective><PaneDirective>npm install @syncfusion/ej2-react-layouts --saveimport { PaneDirective, PanesDirective, SplitterComponent } from '@syncfusion/ej2-react-layouts';
import * as React from "react";
import './App.css';
function App() {
return (
<div className='App'>
<SplitterComponent>
<PanesDirective>
<PaneDirective size='200px'>
<div>Left Panel</div>
</PaneDirective>
<PaneDirective size='300px'>
<div>Right Panel</div>
</PaneDirective>
</PanesDirective>
</SplitterComponent>
</div>
);
}
export default App;import { PaneDirective, PanesDirective, SplitterComponent } from '@syncfusion/ej2-react-layouts';
import * as React from "react";
import './App.css';
function App() {
return (
<div className='App'>
<SplitterComponent>
<PanesDirective>
<PaneDirective size='200px'>
<div>Left Panel</div>
</PaneDirective>
<PaneDirective size='300px'>
<div>Right Panel</div>
</PaneDirective>
</PanesDirective>
</SplitterComponent>
</div>
);
}
export default App;<SplitterComponent orientation='Horizontal'>
<PanesDirective>
<PaneDirective size='25%'><div>Left</div></PaneDirective>
<PaneDirective size='75%'><div>Main Content</div></PaneDirective>
</PanesDirective>
</SplitterComponent><SplitterComponent orientation='Horizontal'>
<PanesDirective>
<PaneDirective size='25%'><div>Left</div></PaneDirective>
<PaneDirective size='75%'><div>Main Content</div></PaneDirective>
</PanesDirective>
</SplitterComponent><SplitterComponent orientation='Vertical'>
<PanesDirective>
<PaneDirective size='50%' collapsed={true}><div>Top</div></PaneDirective>
<PaneDirective size='50%'><div>Bottom</div></PaneDirective>
</PanesDirective>
</SplitterComponent><SplitterComponent orientation='Vertical'>
<PanesDirective>
<PaneDirective size='50%' collapsed={true}><div>Top</div></PaneDirective>
<PaneDirective size='50%'><div>Bottom</div></PaneDirective>
</PanesDirective>
</SplitterComponent><SplitterComponent orientation='Horizontal'>
<PanesDirective>
<PaneDirective size='20%'><div>Sidebar</div></PaneDirective>
<PaneDirective size='60%'><div>Main Content</div></PaneDirective>
<PaneDirective size='20%'><div>Right Panel</div></PaneDirective>
</PanesDirective>
</SplitterComponent><SplitterComponent orientation='Horizontal'>
<PanesDirective>
<PaneDirective size='20%'><div>Sidebar</div></PaneDirective>
<PaneDirective size='60%'><div>Main Content</div></PaneDirective>
<PaneDirective size='20%'><div>Right Panel</div></PaneDirective>
</PanesDirective>
</SplitterComponent>| Prop | Type | Description | When to Use |
|---|---|---|---|
| 'Horizontal' | 'Vertical' | Layout direction | When configuring panel direction |
| string (PaneDirective) | Pane width/height (px, %) | When setting pane dimensions |
| string (PaneDirective) | Minimum pane size | When preventing pane from shrinking too small |
| string (PaneDirective) | Maximum pane size | When limiting pane expansion |
| boolean (PaneDirective) | Initial collapsed state | When panes should start hidden |
| boolean (PaneDirective) | Allow user to collapse | When collapsing should be user-driven |
| boolean (PaneDirective) | Allow user to resize | When preventing manual resizing |
| 属性 | 类型 | 描述 | 使用场景 |
|---|---|---|---|
| 'Horizontal' | 'Vertical' | 布局方向 | 配置面板排列方向时 |
| string (PaneDirective属性) | 窗格宽度/高度(px、%单位) | 设置窗格尺寸时 |
| string (PaneDirective属性) | 窗格最小尺寸 | 避免窗格收缩过小时 |
| string (PaneDirective属性) | 窗格最大尺寸 | 限制窗格扩展范围时 |
| boolean (PaneDirective属性) | 初始折叠状态 | 窗格默认需要隐藏时 |
| boolean (PaneDirective属性) | 允许用户折叠窗格 | 需要用户手动控制折叠时 |
| boolean (PaneDirective属性) | 允许用户调整大小 | 需要禁止手动调整尺寸时 |