|
1 | | -<script lang="ts" setup> |
2 | | -import { ref } from 'vue' |
3 | | -
|
4 | | -import BottomSheet from 'vue-spring-bottom-sheet' |
5 | | -import 'vue-spring-bottom-sheet/dist/style.css' |
6 | | -
|
7 | | -const myBottomSheet = ref<InstanceType<typeof BottomSheet>>() |
8 | | -const maxHeight = ref(0) |
9 | | -const minHeight = ref(0) |
10 | | -
|
11 | | -const expandOnContentDrag = ref(true) |
12 | | -
|
13 | | -const open = () => { |
14 | | - myBottomSheet.value?.open() |
15 | | -} |
16 | | -
|
17 | | -const close = () => { |
18 | | - myBottomSheet.value?.close() |
19 | | -} |
20 | | -
|
21 | | -const snapToPoint = (index: number) => { |
22 | | - myBottomSheet.value?.snapToPoint(index) |
23 | | -} |
| 1 | +<script> |
| 2 | +// Use a static import for server-side compatibility |
| 3 | +import '~/assets/css/style.css' |
24 | 4 | </script> |
25 | 5 |
|
26 | 6 | <template> |
27 | | - <button class="btn btn-primary" type="button" @click="open">Open bottom sheet</button> |
28 | | - <ClientOnly> |
29 | | - <BottomSheet |
30 | | - ref="myBottomSheet" |
31 | | - :snap-points="[maxHeight / 3, maxHeight / 1.5, maxHeight]" |
32 | | - :blocking="true" |
33 | | - :can-overlay-close="true" |
34 | | - :can-swipe-close="true" |
35 | | - :expand-on-content-drag="expandOnContentDrag" |
36 | | - @min-height="(n) => (minHeight = n)" |
37 | | - @max-height="(n) => (maxHeight = n)" |
38 | | - > |
39 | | - <template #header> |
40 | | - <h1 style="font-size: 24px; margin: 0; text-align: center">Header</h1> |
41 | | - </template> |
42 | | - <div class="button-group"> |
43 | | - <button type="button" @click="snapToPoint(2)">Top</button> |
44 | | - <button type="button" @click="snapToPoint(1)">Middle</button> |
45 | | - <button type="button" @click="snapToPoint(0)">Bottom</button> |
46 | | - </div> |
47 | | - <button type="button" @click="expandOnContentDrag = !expandOnContentDrag"> |
48 | | - {{ expandOnContentDrag ? 'Enable' : 'Disable' }} expand on content drag |
49 | | - </button> |
50 | | - <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod, nisl eget consectetur sagittis, nunc</p> |
51 | | - <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod, nisl eget consectetur sagittis, nunc</p> |
52 | | - <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod, nisl eget consectetur sagittis, nunc</p> |
53 | | - <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod, nisl eget consectetur sagittis, nunc</p> |
54 | | - <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod, nisl eget consectetur sagittis, nunc</p> |
55 | | - <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec euismod, nisl eget consectetur sagittis, nunc</p> |
56 | | - <details> |
57 | | - <summary>Epcot Center</summary> |
58 | | - <p> |
59 | | - Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks |
60 | | - and seasonal special events. |
61 | | - </p> |
62 | | - <p> |
63 | | - Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks |
64 | | - and seasonal special events. |
65 | | - </p> |
66 | | - <p> |
67 | | - Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks |
68 | | - and seasonal special events. |
69 | | - </p> |
70 | | - <p> |
71 | | - Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks |
72 | | - and seasonal special events. |
73 | | - </p> |
74 | | - <p> |
75 | | - Epcot is a theme park at Walt Disney World Resort featuring exciting attractions, international pavilions, award-winning fireworks |
76 | | - and seasonal special events. |
77 | | - </p> |
78 | | - </details> |
79 | | - <template #footer> |
80 | | - <button type="button" @click="close">Close bottom sheet</button> |
81 | | - </template> |
82 | | - </BottomSheet> |
83 | | - </ClientOnly> |
| 7 | + <NaviagtionBar /> |
| 8 | + <NuxtPage /> |
84 | 9 | </template> |
85 | | - |
86 | | -<style> |
87 | | -body, |
88 | | -html { |
89 | | - overscroll-behavior-y: none; |
90 | | -} |
91 | | -
|
92 | | -body { |
93 | | - min-height: 100dvh; |
94 | | - overflow: hidden; |
95 | | - width: 100%; |
96 | | -} |
97 | | -
|
98 | | -.button-group { |
99 | | - display: flex; |
100 | | - gap: 1rem; |
101 | | - margin-bottom: 1rem; |
102 | | -} |
103 | | -
|
104 | | -.button-group button { |
105 | | - flex: 1 1 33%; |
106 | | -} |
107 | | -
|
108 | | -#app { |
109 | | - padding: 0; |
110 | | - width: 100%; |
111 | | -} |
112 | | -</style> |
0 commit comments