Skip to content

GradientEditorBar

GradientEditorBar ist das ziehbare Balken-Primitiv, das innerhalb von Verlaufs-Editoren verwendet wird.

Props

PropDefaultType
stops*
Aktuelle Verlaufsstopps.
GradientStop[]
activeStopIndex*
Aktiver Stopp-Index.
number
barBackground*
CSS-Hintergrund-String für den Balken.
string

Ereignisse

EventPayloadDescription
selectStopindex: numberAusgelöst, wenn ein Stopp ausgewählt wird.
dragStopindex: number, position: numberAusgelöst, während ein Stopp gezogen wird.

Slots

SlotPropsDescription
defaultBalken-Zustand + Zieh-HandlerVollständiger Verlaufsbalken-Render-Vertrag.

Standard-Slot-Props

ts
{
  stops: GradientStop[]
  activeStopIndex: number
  barBackground: string
  barRef: (el: unknown) => void
  onStopPointerDown: (index: number, event: PointerEvent) => void
  onPointerMove: (event: PointerEvent) => void
  onPointerUp: () => void
  draggingIndex: number | null
}

Beispiel

vue
<GradientEditorBar
  :stops="stops"
  :active-stop-index="activeStopIndex"
  :bar-background="barBackground"
  @select-stop="selectStop"
  @drag-stop="dragStop"
  v-slot="ctx"
>
  <MyGradientBar v-bind="ctx" />
</GradientEditorBar>

Verwandte APIs

Released under the MIT License.