Skip to content

Drawer ​

Ekran chetidan sirg'alib kiradigan panel. Formalar, tafsilot ko'rinishlari, sozlamalar va navigatsiya uchun ishlating.

Basic ​

vue
<template>
  <VxDrawer v-model="show" title="Drawer" description="A basic drawer.">
    <p>Content goes here.</p>
  </VxDrawer>
</template>

Direction ​

Drawer istalgan tomondan sirg'alib kirishi mumkin: right (sukut), left, top yoki bottom.

vue
<template>
  <VxDrawer v-model="show" title="Right" direction="right" />
  <VxDrawer v-model="show" title="Left" direction="left" />
  <VxDrawer v-model="show" title="Top" direction="top" />
  <VxDrawer v-model="show" title="Bottom" direction="bottom" />
</template>

Sizes ​

Beshta o'lcham mavjud: sm, md (sukut), lg, xl, full.

vue
<template>
  <VxDrawer size="sm" title="Small" />
  <VxDrawer size="md" title="Medium" />
  <VxDrawer size="lg" title="Large" />
  <VxDrawer size="xl" title="XL" />
  <VxDrawer size="full" title="Full" />
</template>

Form Drawer ​

Keng tarqalgan qolip: drawer ichidagi saqlash/bekor qilish amallari bilan forma.

vue
<template>
  <VxDrawer v-model="show" title="Edit Profile">
    <form>
      <input v-model="form.name" placeholder="Name" />
      <input v-model="form.email" placeholder="Email" />
    </form>
    <template #footer>
      <button @click="show = false">Cancel</button>
      <button @click="save">Save</button>
    </template>
  </VxDrawer>
</template>

Scrollable Content ​

Tarkib sig'masa, body aylanadi, header va footer esa qotirilgan holda qoladi.

vue
<template>
  <VxDrawer v-model="show" title="Terms of Service">
    <div>Long scrollable content...</div>
    <template #footer>
      <button @click="show = false">Decline</button>
      <button @click="accept">Accept</button>
    </template>
  </VxDrawer>
</template>

Custom Header ​

vue
<template>
  <VxDrawer v-model="show">
    <template #header>
      <div class="custom-header">
        <MyIcon />
        <div>
          <h3>Task Completed</h3>
          <p>Review the details below</p>
        </div>
      </div>
    </template>
    <p>Content...</p>
  </VxDrawer>
</template>
vue
<template>
  <VxDrawer v-model="show" title="Notifications" :show-footer="false">
    <NotificationList />
  </VxDrawer>
</template>

Persistent ​

Overlay bosilganda yoki Escape bosilganda drawer yopilish o'rniga silkinadi.

vue
<template>
  <VxDrawer v-model="show" persistent title="Unsaved" />
</template>

No Overlay ​

vue
<template>
  <VxDrawer v-model="show" hide-overlay title="Side Panel" />
</template>

Loading ​

vue
<template>
  <VxDrawer v-model="show" :loading="isLoading" title="Loading" />
</template>

Nested Drawers ​

Bir drawer ichidan boshqa drawer ochiladi. Har biri o'z overlay va z-indexiga ega bo'ladi.

vue
<template>
  <VxDrawer v-model="outer" title="Settings" size="lg">
    <SettingsList @open-detail="inner = true" />
  </VxDrawer>
  <VxDrawer v-model="inner" title="Detail" size="sm">
    <DetailContent />
  </VxDrawer>
</template>

Props ​

PropTypeDefaultDescription
modelValuebooleanfalseKo'rsatish/yashirish (v-model)
titlestring''Header sarlavhasi
descriptionstring''Header tavsifi
direction'left' | 'right' | 'top' | 'bottom''right'Sirg'alish yo'nalishi
size'sm' | 'md' | 'lg' | 'xl' | 'full''md'Panel o'lchami
closablebooleantrueYopish tugmasini ko'rsatish
closeOnOverlaybooleantrueOverlay bosilganda yopish
closeOnEscbooleantrueEscape bosilganda yopish
persistentbooleanfalseYopishga urinilganda silkitish
hideOverlaybooleanfalseBackdroz yo'q
loadingbooleanfalseYuklanish overlayi
showFooterbooleantrueFooter sohasini ko'rsatish
beforeClose() => boolean | Promise<boolean>—Yopishdan oldingi himoya
destroyOnClosebooleanfalseYopilganda tarkibni yo'q qilish
teleportTostring'body'Teleport maqsadi

Events ​

EventDescription
update:modelValueQiymat o'zgardi
closeDrawer yopildi
openedOchilish animatsiyasi tugadi
closedYopilish animatsiyasi tugadi

Slots ​

SlotDescription
defaultBody tarkibi
headerMaxsus header (title/description o'rnini bosadi)
footerMaxsus footer tugmalari

Exposed ​

MethodDescription
close()Dasturiy ravishda yopish (beforeClose ni hurmat qiladi)