Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

🔥 A nice clean and touch-friendly bottom sheet component based on Vue.js and Hammer.js for Vue 3

NotificationsYou must be signed in to change notification settings

vaban-ru/vue-bottom-sheet

Repository files navigation

Example

Vue Bottom Sheet

SizeDownloadsVersion

A nice clean and touch-friendly bottom sheet component based onVue.js andhammer.js for Vue 3

Installation

NPM

npm install @webzlodimir/vue-bottom-sheet

Yarn

yarn add @webzlodimir/vue-bottom-sheet

Usage

<template>  <vue-bottom-sheetref="myBottomSheet">    <h1>Lorem Ipsum</h1>    <h2>What is Lorem Ipsum?</h2>    <p>      <strong>Lorem Ipsum</strong> is simply dummy text    </p>  </vue-bottom-sheet></template><script setup>importVueBottomSheetfrom"@webzlodimir/vue-bottom-sheet";import"@webzlodimir/vue-bottom-sheet/dist/style.css";import {ref }from"vue";constmyBottomSheet=ref(null)constopen= ()=> {myBottomSheet.value.open();}constclose= ()=> {myBottomSheet.value.close();}</script>

Usagesetup + TS

<template>  <vue-bottom-sheetref="myBottomSheet">    <h1>Lorem Ipsum</h1>    <h2>What is Lorem Ipsum?</h2>    <p>      <strong>Lorem Ipsum</strong> is simply dummy text    </p>  </vue-bottom-sheet></template><script setup lang="ts">importVueBottomSheetfrom"@webzlodimir/vue-bottom-sheet";import"@webzlodimir/vue-bottom-sheet/dist/style.css";import {ref }from"vue";const myBottomSheet=ref<InstanceType<typeofVueBottomSheet>>()const open= ()=> {myBottomSheet.value.open();}const close= ()=> {myBottomSheet.value.close();}</script>

Usage in Nuxt 3

For Nuxt 3, just wrap component in<client-only>

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

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
transition-durationNumberTransition animation duration:transition-duration="0.5"0.5

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:

<template>  <vue-bottom-sheetref="myBottomSheet">    <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></template>

About

🔥 A nice clean and touch-friendly bottom sheet component based on Vue.js and Hammer.js for Vue 3

Topics

Resources

Stars

Watchers

Forks

Contributors9


[8]ページ先頭

©2009-2025 Movatter.jp