Skip to content

GradientEditorStop

GradientEditorStop — headless-примитив для рендеринга и редактирования одной точки градиента.

Props

PropDefaultType
stop*
Текущее значение точки.
GradientStop
index*
Индекс текущей точки.
number
active*
Является ли эта точка активной.
boolean

Events

EventPayloadDescription
selectindex: numberГенерируется при выборе точки.
updatePositionindex: number, position: numberГенерируется при изменении позиции точки.
updateColorindex: number, hex: stringГенерируется при изменении цвета точки.
updateOpacityindex: number, opacity: numberГенерируется при изменении прозрачности точки.
removeindex: numberГенерируется при удалении точки.

Slots

SlotPropsDescription
defaultstop 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>

Связанные API

Released under the MIT License.