docs/en-US/component/splitter.md
Divide the area horizontally or vertically, and freely drag to adjust the size of each area.
The most basic usage, if no default size is passed, it will be automatically divided equally.
:::demo
splitter/basic
:::
Use vertical orientation.
:::demo
splitter/vertical
:::
Configuring collapsible provides quick shrinking capability. You can use the min property to prevent expanding through dragging after collapsing.
:::demo
splitter/collapsible
:::
When either panel disables resizable, dragging will be disabled.
:::demo
splitter/disableDrag
:::
v-model:size can get the panel size.
:::demo
splitter/size
:::
When lazy is enabled, the panel size will not update in real time during dragging, but only after the drag ends.
:::demo
splitter/lazy
:::
| Name | Description | Type | Default |
|---|---|---|---|
| layout | Layout direction of the splitter | ^[enum]'horizontal' | 'vertical' | horizontal |
| lazy ^(2.11.0) | Whether to enable lazy mode | ^[boolean] | false |
| Name | Description | type |
|---|---|---|
| resize-start | Triggered when starting to resize a panel, index is the drag bar index | ^[Function](index: number, sizes: number[]) => void |
| resize | Triggered while resizing a panel, index is the drag bar index | ^[Function](index: number, sizes: number[]) => void |
| resize-end | Triggered when panel resizing ends, index is the drag bar index | ^[Function](index: number, sizes: number[]) => void |
| collapse ^(2.10.3) | Triggered when a panel is collapsed, index is the drag bar index | ^[Function](index: number, type: 'start' | 'end', sizes: number[]) => void |
| Name | Description | Type | Default |
|---|---|---|---|
| size / v-model:size | Size of the panel (in pixels or percentage) | ^[string] / ^[number] | - |
| min | Minimum size of the panel (in pixels or percentage) | ^[string] / ^[number] | - |
| max | Maximum size of the panel (in pixels or percentage) | ^[string] / ^[number] | - |
| resizable | Whether the panel can be resized | ^[boolean] | true |
| collapsible | Whether the panel can be collapsed | ^[boolean] | false |
| Name | Description | type |
|---|---|---|
| update:size | Triggered when panel size changes | ^[Function](size: number) => void |
| Name | Description |
|---|---|
| default | Default content of the panel |
| start-collapsible | Custom content for the start collapsible button |
| end-collapsible | Custom content for the end collapsible button |
| Name | Description | Type |
|---|---|---|
| splitterPanelRef ^(2.11.9) | SplitterPanel html element | ^[object]Ref<HTMLDivElement> |