Skip to content

Tour ​

Sahifadagi elementlarni ajratib ko‘rsatib, qadamba-qadam yo‘riqnomalarni namoyish etadigan boshlab beruvchi walkthrough komponenti. Onboarding, yangi imkoniyatlarni kashf qilish va darsliklar uchun juda qulay.

Basic ​

"Start Tour" tugmasini bosib, silliq o‘tishlar bilan ajratilgan elementlarni bosqichma-bosqich ko‘rib chiqing.

vue
<script setup>
import { ref } from 'vue'
import { VxTour, VxButton, VxInput } from 'veloxui'

const showTour = ref(false)
const steps = [
  {
    target: '#dashboard-btn',
    title: 'Dashboard',
    description: 'Access your main dashboard with key metrics.',
  },
  {
    target: '#settings-btn',
    title: 'Settings',
    description: 'Configure your preferences and security options.',
  },
  {
    target: '#search-input',
    title: 'Search',
    description: 'Find anything across your workspace.',
  },
]
</script>

<template>
  <VxButton id="dashboard-btn" type="primary">Dashboard</VxButton>
  <VxButton id="settings-btn">Settings</VxButton>
  <VxInput id="search-input" placeholder="Search..." />

  <VxButton @click="showTour = true">Start Tour</VxButton>
  <VxTour v-model="showTour" :steps="steps" />
</template>

Placement ​

Har bir qadamda popover pozitsiyasini placement parametri orqali boshqaring: top, bottom, left yoki right. Agar ko‘rsatilmasa, eng mos joy avtomatik aniqlanadi.

vue
<script setup>
import { ref } from 'vue'
import { VxTour, VxButton } from 'veloxui'

const showTour = ref(false)
const steps = [
  { target: '#btn-top', title: 'Top', description: 'Popover above.', placement: 'top' },
  { target: '#btn-right', title: 'Right', description: 'Popover to the right.', placement: 'right' },
  { target: '#btn-bottom', title: 'Bottom', description: 'Popover below.', placement: 'bottom' },
  { target: '#btn-left', title: 'Left', description: 'Popover to the left.', placement: 'left' },
]
</script>

<template>
  <VxButton id="btn-top">Top</VxButton>
  <VxButton id="btn-right">Right</VxButton>
  <VxButton id="btn-bottom">Bottom</VxButton>
  <VxButton id="btn-left">Left</VxButton>
  <VxButton @click="showTour = true">Start Tour</VxButton>
  <VxTour v-model="showTour" :steps="steps" />
</template>

Connected Cards ​

Foydalanuvchilarni murakkab layoutlar bo‘ylab yo‘naltirish uchun karta shaklidagi UI elementlarini nishonga oling.

Create Project
Start something new
Team Settings
Manage members
Analytics
View insights
vue
<script setup>
import { ref } from 'vue'
import { VxTour, VxButton } from 'veloxui'

const showTour = ref(false)
const steps = [
  { target: '#create-card', title: 'Create Project', description: 'Start a new project.' },
  { target: '#team-card', title: 'Team Settings', description: 'Manage your team.' },
  { target: '#analytics-card', title: 'Analytics', description: 'View performance insights.' },
]
</script>

<template>
  <div id="create-card">...</div>
  <div id="team-card">...</div>
  <div id="analytics-card">...</div>
  <VxButton @click="showTour = true">Start Tour</VxButton>
  <VxTour v-model="showTour" :steps="steps" />
</template>

Custom Content ​

Har bir qadamning kontentini to‘liq moslashtirish uchun default slotdan foydalaning. Slotga step, index, total, next, prev va close uzatiladi.

vue
<script setup>
import { ref } from 'vue'
import { VxTour, VxButton } from 'veloxui'

const showTour = ref(false)
const steps = [
  { target: '#home', title: 'Welcome!', description: 'Let us show you around.' },
  { target: '#actions', title: 'Quick Actions', description: 'Access frequent actions here.' },
]
</script>

<template>
  <VxTour v-model="showTour" :steps="steps">
    <!-- Custom step content via default slot -->
    <template #default="{ step, index, total, next, prev, close }">
      <div style="display: flex; align-items: center; gap: 10px; margin-bottom: 8px;">
        <span class="step-badge">{{ index + 1 }}</span>
        <span class="step-title">{{ step?.title }}</span>
      </div>
      <p>{{ step?.description }}</p>
    </template>
  </VxTour>
</template>

Keyboard Navigation ​

Tour qutichadan chiqqan holda klaviatura navigatsiyasini qo‘llab-quvvatlaydi:

  • O‘ng / Pastki strelka — Keyingi qadam
  • Chap / Yuqori strelka — Oldingi qadam
  • Escape — Tour’ni yopish

API ​

VxTour Props ​

PropTypeDefaultDescription
v-modelbooleanfalseTour ko‘rinishini boshqaradi
stepsTourStep[][]Qadamlar ta’rifi massivi
currentnumber0Joriy qadam indeksi
maskClosablebooleantrueQorong‘i overlay bosilganda tour’ni yopish
showSkipbooleantrue"Skip" tugmasini ko‘rsatish
paddingnumber10Ajratilgan element atrofidagi padding (px)
scrollIntoViewbooleantrueNishonni avtomatik ko‘rinish maydoniga scroll qilish

TourStep ​

PropertyTypeRequiredDescription
targetstring | () => HTMLElementYesCSS selektor yoki nishon elementni qaytaruvchi funksiya
titlestringNoQadam sarlavhasi
descriptionstringNoQadam tavsifi matni
placement'top' | 'bottom' | 'left' | 'right'NoPopover joylashuvi (ko‘rsatilmasa avtomatik aniqlanadi)

Events ​

EventPayloadDescription
update:modelValuebooleanTour ochiq/yopiq holati o‘zgardi
update:currentnumberJoriy qadam indeksi o‘zgardi
changenumberQadam o‘zgardi (yangi indeks)
finish—Foydalanuvchi oxirgi qadamda "Finish" bosdi
skip—Foydalanuvchi "Skip" bosdi

Slots ​

SlotPropsDescription
default{ step, index, total, isFirst, isLast, next, prev, close }Qadamning maxsus kontenti
footer{ index, total, isFirst, isLast, next, prev, close }Maxsus footer (nuqtalar va nav tugmalar o‘rniga)