Skip to content

Open source personal finance application

feat (BottomSheet): update

ilkome8c4b26960dc5
diff --git a/components/base/BottomSheet.vue b/components/base/BottomSheet.vue
index 7c00661c..a900cf5e 100644
--- a/components/base/BottomSheet.vue
+++ b/components/base/BottomSheet.vue
@@ -6,6 +6,8 @@ export default defineComponent({
keepAlive: { type: Boolean, default: false },
show: { type: Boolean, default: false },
maxHeight: { type: Number, default: null },
+ height: { type: Number, default: null },
+ insideClass: { type: String, default: null },
},
setup(props, { emit }) {
@@ -47,6 +49,13 @@ export default defineComponent({
return `${props.maxHeight - drugHeader.value?.clientHeight - 40}px`
})
+ const heightScroll = computed(() => {
+ if (!props.height || !drugHeader.value)
+ return false
+
+ return `${props.height - drugHeader.value?.clientHeight - 40}px`
+ })
+
/**
* Next current y
*/
@@ -323,19 +332,19 @@ export default defineComponent({
}, { immediate: true })
return {
+ close,
container,
+ debug,
drug,
drugHeader,
+ drugStyles,
handler,
-
- opened,
- debug,
isDraging,
+ maxHeightScroll,
+ heightScroll,
open,
- close,
+ opened,
overlayStyles,
- drugStyles,
- maxHeightScroll,
}
},
})
@@ -360,7 +369,10 @@ export default defineComponent({
.drug__header(ref="drugHeader")
slot(name="header" :close="close")
- .drug__inside(:class="{ _scroll: !!maxHeightScroll }" :style="{ maxHeight: maxHeightScroll }")
+ .drug__inside(
+ :class="[insideClass, { _scroll: !!maxHeightScroll, scrollerBlock: !!maxHeightScroll }]"
+ :style="{ maxHeight: maxHeight && maxHeightScroll, height: height && heightScroll }"
+ )
.handler(ref="handler")
slot(name="handler" :close="close")