Backtop
Bosilganda tepaga qaytib aylantiriladigan tugma. Ma'lum chegaradan o'tgandan keyin paydo bo'ladi. Progress halqasi, o'lchamlar, shakllar va boshqalarni qo'llab-quvvatlaydi.
Basic
Backtop tugmasini ko'rish uchun quti ichida pastga aylantiring.
<VxBacktop />Progress Ring
show-progress bilan tugma atrofida doiraviy progress indikatorini ko'rsating.
<VxBacktop show-progress />Scroll Percentage
Tugma ichida aylantirish foizini show-percent bilan ko'rsating. show-progress bilan yaxshi birlashadi.
<VxBacktop show-progress show-percent />Sizes
Uchta o'lcham: small (32px), default (40px), large (48px).
<VxBacktop size="small" />
<VxBacktop size="default" />
<VxBacktop size="large" />Shape
circle (standart) va square (yumaloqlangan kvadrat) orasida tanlang.
<VxBacktop shape="circle" />
<VxBacktop shape="square" />Tooltip
tooltip prop i bilan tabiiy tooltip qo'shing.
<VxBacktop tooltip="Tepaga qaytish" />Scroll To Element
scroll-to yordamida tepa o'rniga ma'lum elementga aylantiring.
<VxBacktop scroll-to="#my-section" />Custom Content
Maxsus kontent uchun standart slot dan foydalaning. Slot percent ni oshkor qiladi.
<VxBacktop show-progress size="large">
<template #default="{ percent }">
<span>{{ percent }}%</span>
</template>
</VxBacktop>Full Custom Button
Butun tugmani almashtirish uchun #button slot idan foydalaning. U { percent, visible, scroll, style } ni oladi — aylantirishni ishga tushirish uchun scroll($event) ni chaqiring, pozitsiyalash uchun style ni qo'llang.
<VxBacktop>
<template #button="{ percent, scroll, style }">
<div :style="style" @click="scroll">
Tepaga qaytish · {{ percent }}%
</div>
</template>
</VxBacktop>Disabled
<VxBacktop disabled />Auto Hide
Bo'sh turish vaqti (ms) dan keyin yashirish. Tugma qayta aylantirganingizda paydo bo'ladi.
<!-- 3 soniya aylantirmaslikdan keyin yashirish -->
<VxBacktop :auto-hide="3000" />API
VxBacktop Props
| Prop | Type | Default | Description |
|---|---|---|---|
target | string | HTMLElement | window | Aylantirish konteyneri |
visibility-height | number | 200 | Ko'rsatish uchun aylantirish chegarasi (px) |
right | number | 40 | O'ng offset (px) |
bottom | number | 40 | Pastki offset (px) |
smooth | boolean | true | Silliq aylantirish animatsiyasi |
size | 'small' | 'default' | 'large' | 'default' | Tugma o'lchami |
shape | 'circle' | 'square' | 'circle' | Tugma shakli |
show-progress | boolean | false | Doiraviy aylantirish progress halqasini ko'rsatish |
show-percent | boolean | false | Aylantirish foiz matnini ko'rsatish |
scroll-to | string | — | Tepa o'rniga aylantiriladigan CSS selector |
tooltip | string | — | Tabiiy tooltip matni |
disabled | boolean | false | Tugmani o'chirib qo'yish |
auto-hide | number | 0 | Bo'sh turgandan keyin avto-yashirish (ms), 0 = o'chirilgan |
root-class | string | string[] | object | — | Ildiz elementidagi class |
Events
| Event | Payload | Description |
|---|---|---|
click | MouseEvent | Tugma bosildi |
Slots
| Slot | Props | Description |
|---|---|---|
default | { percent: number } | Maxsus ichki kontent (ikonkani almashtiradi) |
button | { percent: number, visible: boolean, scroll: Function, style: object } | Butun tugmani almashtiradi. Pozitsiyalash uchun style dan foydalaning, aylantirishni ishga tushirish uchun scroll($event) ni chaqiring. |
Exposed
| Name | Type | Description |
|---|---|---|
visible | Ref<boolean> | Tugma ko'rinadimi |
scrollPercent | Ref<number> | Joriy aylantirish foizi (0–100) |