Tour
Since v2.2.0

Used to guide users on how to use certain features.

Demos#

Basis Usage#

Simplest usage.

Please select

Template Step#

Use the TourStep component to configure tour steps.

Tip Placement#

By setting the placement prop in the step options, you can specify the placement of the step's tooltip.

When no valid target is specified, the tooltip will be centered.

API#

Preset Types#

ts
type TourType = 'default' | 'primary' | 'info' | 'success' | 'warning' | 'error'
type TourSignType = 'dot' | 'bar' | 'count'

interface TourVirtual {
  getBoundingClientRect(): { top: number, left: number, width: number, height: number }
}

type TourTarget =
  | MaybeRef<string | MaybeInstance | TourVirtual>
  | (() => string | MaybeElement | TourVirtual)

interface TourPayload {
  start(): void,
  prev(): void,
  next(autoClose?: boolean): void,
  close(): void
}

type TourStepRenderFn = (payload: TourPayload) => any

interface TourStepOptions {
  target?: TourTarget,
  placement?: Placement,
  title?: string,
  content?: string,
  order?: number,
  renderer?: TourStepRenderFn
}

type TourSlotParams = TourPayload & { step: TourStepOptions, index: number }

Tour Props#

NameTypeDescriptionDefaultSince
activebooleanSet whether to display the tour, you can use v-model two-way bindingfalse-
closablebooleanSet whether to display a close buttontrue-
hide-maskbooleanSet whether to hide the mask layerfalse-
indexnumberSet the current step of tour, you can use v-model two-way binding0-
localeLocaleConfig['tour']Set the locale confignull-
paddingnumber | numberSet the padding of the target area10-
permeablebooleanSet whether mouse events can penetrate to the target areafalse-
sign-typeTourSignTypeSet the type of step sign'dot'-
stepsTourStepOptions[]Tour steps configuration[]-
typeTourTypeSet the type of tips for tour steps'default'-

Tour Events#

NameDescriptionParametersSince
changeEmitted when the current step of the tour changes(index: number, step: TourStepOptions)-
closeEmitted when the close button is used to trigger the close--
toggleEmitted when the active state of tour changes(active: boolean)-

Tour Slots#

NameDescriptionParametersSince
actionsThe actions slots for tipsTourSlotParams-
bodyThe content slot for the tipsTourSlotParams-
closeThe close button slot for the tipsTourSlotParams-
defaultUsed to define the TourStep components--
footerThe footer slot for tipsTourSlotParams-
headerThe header slot for tipsTourSlotParams-
signThe sign slot for the tipsTourSlotParams-
titleThe title slot for the tipsTourSlotParams-

TourStep Props#

NameTypeDescriptionDefaultSince
contentstringSet the content of the tip''-
ordernumberSet the order of the tip0-
placementPlacementSet the placement of the tip, the optional values are the same as floating-ui'bottom'-
rendererTourStepRenderFnCustom render function for the tipnull-
targetTourTargetSet the target for the tipnull-
titlestringSet the title of the tip''-
typeTourTypeSet the type of tip'default'-