GradientEditorStop
GradientEditorStop — headless-примитив для рендеринга и редактирования одной точки градиента.
Props
| Prop | Default | Type |
|---|---|---|
stop*Текущее значение точки. | — | GradientStop |
index*Индекс текущей точки. | — | number |
active*Является ли эта точка активной. | — | boolean |
Events
| Event | Payload | Description |
|---|---|---|
select | index: number | Генерируется при выборе точки. |
updatePosition | index: number, position: number | Генерируется при изменении позиции точки. |
updateColor | index: number, hex: string | Генерируется при изменении цвета точки. |
updateOpacity | index: number, opacity: number | Генерируется при изменении прозрачности точки. |
remove | index: number | Генерируется при удалении точки. |
Slots
| Slot | Props | Description |
|---|---|---|
default | stop state + update handlers | Полный контракт рендеринга точки градиента. |
Пропы слота default
ts
{
stop: GradientStop
index: number
active: boolean
positionPercent: number
opacityPercent: number
hex: string
css: string
select: () => void
updatePosition: (position: number) => void
updateColor: (hex: string) => void
updateOpacity: (opacity: number) => void
remove: () => void
}Пример
vue
<GradientEditorStop :stop="stop" :index="index" :active="active" v-slot="ctx">
<MyGradientStopRow v-bind="ctx" />
</GradientEditorStop>