Разделитель
PrimeNG/Splitter (opens in a new tab)
Разделитель используется для разделения и изменения размера панелей.
С чего начать
Подключите модуль
import { SplitterModule } from 'primeng/splitter';
Встройте компонент с помощью тэга p-splitter.
Horizontal
Panel 1Panel 2
Vertical
Panel 1Panel 2
Nested
Panel 1Panel 2Panel 3Panel 4
Свойства
Name | Type | Default | Description |
---|---|---|---|
panelSizes | number | null | Size of the elements relative to 100%. |
minSizes | number | null | Minimum size of the elements relative to 100%. |
layout | string | horizontal | Orientation of the panels, valid values are "horizontal" and "vertical". |
gutterSize | number | 4 | Size of the divider in pixels. |
stateKey | string | null | Storage identifier of a stateful Splitter. |
stateStorage | string | session | Defines where a stateful splitter keeps its state, valid values are "session" for sessionStorage and "local" for localStorage. |
style | object | null | Inline style of the component. |
styleClass | string | null | Style class of the component. |
panelStyleClass | string | null | Style class of the panel. |
panelStyle | object | null | Inline style of the pnanel. |
События
Name | Parameters | Description |
---|---|---|
onResizeStart | event.originalEvent: Original event<br>event.sizes: Sizes of the panels as an array | Callback to invoke when resize starts. |
onResizeEnd | event.originalEvent: Original event<br>event.sizes: Sizes of the panels as an array | Callback to invoke when resize ends. |
Шаблоны
Name | Parameters |
---|---|
panel | - |
Стилизация
Name | Element |
---|---|
p-splitter | Container element. |
p-splitter | Container element during resize. |
p-splitter-horizontal | Container element with horizontal layout. |
p-splitter-vertical | Container element with vertical layout. |
p-splitter-panel | Splitter panel element. |
p-splitter-gutter | Gutter element to use when resizing the panels. |
p-splitter-gutter-handle | Handl element of the gutter. |