0.0.9 • Published 9 months ago

@webzlodimir/vue-bottom-sheet-vue2 v0.0.9

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Example

Vue Bottom Sheet Vue 2

Size Downloads Version

A nice clean and touch-friendly bottom sheet component based on Vue.js 2 and hammer.js for Vue 2

Installation

NPM

npm install @webzlodimir/vue-bottom-sheet-vue2

Yarn

yarn add @webzlodimir/vue-bottom-sheet-vue2

Usage

<template>
  <vue-bottom-sheet-vue2 ref="myBottomSheet">
    <h1>Lorem Ipsum</h1>
    <h2>What is Lorem Ipsum?</h2>
    <p>
      <strong>Lorem Ipsum</strong> is simply dummy text
    </p>
  </vue-bottom-sheet-vue2>
</template>

<script>
  import  VueBottomSheetVue2 from "@webzlodimir/vue-bottom-sheet-vue2";

  export default {
    components: {
      VueBottomSheetVue2
    },
    methods: {
      open() {
        this.$refs.myBottomSheet.open();
      },
      close() {
        this.$refs.myBottomSheet.close();
      }
    }
  }
</script>

Props

PropTypeDescriptionExampleDefaults
max-widthNumberSet max-width of component card in px:max-width="640"640
max-heightNumberSets the maximum height of the window, if not set it takes the height of the content:max-height="90"-
can-swipeBooleanEnable or disable swipe to close:can-swipe="false"true
overlayBooleanEnable overlay:overlay="false"true
overlay-colorStringSet overlay color with opacityoverlay-color="#0000004D"#0000004D
overlay-click-closeBooleanClose window on overlay click:overlay-click-close="false"true
close-height-percent v0.0.7NumberSet the percentage of the height in the Off state to the height in the fully enabled state. 100 indicates that the height is fully off:close-height-percent="50"true
init-sheet-height v0.0.8NumberSets the initial height of the window, if not set it takes the height of the content:init-sheet-height="300"-
z-index v0.0.8NumberSet z-index of component card:z-index="1001"99999
custom-class v0.0.8StringThe component custom class namecustom-class="custom-style"''
drag-color v0.0.8StringDrag the bar icon colordrag-color="#ffc107"#333333

Events

EventDescriptionExample
openedFire when card component is opened@opened=""
closedFire when card component is closed@closed=""
dragging-upFire while card component dragging up@dragging-up=""
dragging-downFire while card component dragging down@dragging-down=""

Slots

You can use this named slots:

SlotDescription
drag v0.0.8Drag the bar icon
headerheader content
defaultmain content
footerfooter content
<template>
  <vue-bottom-sheet-vue2 ref="myBottomSheet">
    <template #drag>
      <div style="width: 40px;height: 4px;background: #31d2f2;border-radius: 8px;margin: 0 auto;"></div>
    </template>
    <template #header>
      <h1>Lorem Ipsum</h1>
    </template>
    <template #default>
      <h2>What is Lorem Ipsum?</h2>
    </template>
    <template #footer>
      <p>
        <strong>Lorem Ipsum</strong> is simply dummy text
      </p>
    </template>
  </vue-bottom-sheet-vue2>
</template>
0.0.9

9 months ago

0.0.8

9 months ago

0.0.7

9 months ago

0.0.6

9 months ago

0.0.5

9 months ago

0.0.4

9 months ago

0.0.3

9 months ago

0.0.2

9 months ago

0.0.1

9 months ago