App.vue
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
<template> <div> <!-- Buttons to trigger open and close --> <button @click="open">Open Bottom Sheet</button> <button @click="close">Close Bottom Sheet</button> <!-- Vue Bottom Sheet component --> <vue-bottom-sheet ref="myBottomSheet"> <h1>Lorem Ipsum</h1> <h2>What is Lorem Ipsum?</h2> <p> <strong>Lorem Ipsum</strong> is simply dummy text used in the printing and typesetting industry. </p> </vue-bottom-sheet> </div> </template> <script setup> import VueBottomSheet from "@webzlodimir/vue-bottom-sheet"; import "@webzlodimir/vue-bottom-sheet/dist/style.css"; import { ref } from "vue"; const myBottomSheet = ref(null); // Open the bottom sheet const open = () => { myBottomSheet.value.open(); } // Close the bottom sheet const close = () => { myBottomSheet.value.close(); } </script> |