fix:最新版本
This commit is contained in:
36
src/components/page-scroll-view/index.vue
Normal file
36
src/components/page-scroll-view/index.vue
Normal file
@@ -0,0 +1,36 @@
|
||||
<template>
|
||||
<scroll-view
|
||||
class="page-scroll-view"
|
||||
scroll-y
|
||||
:style="mergedStyle"
|
||||
v-bind="$attrs"
|
||||
>
|
||||
<slot />
|
||||
</scroll-view>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import type { CSSProperties } from 'vue'
|
||||
import { computed } from 'vue'
|
||||
import { usePageScrollHeight } from '@/hooks/use-page-scroll-height'
|
||||
|
||||
defineOptions({ inheritAttrs: false })
|
||||
|
||||
const props = defineProps<{
|
||||
/** 外部传入时覆盖内部计算(如设备详情页自定义顶部区域) */
|
||||
scrollStyle?: CSSProperties
|
||||
extraBottomPx?: number
|
||||
}>()
|
||||
|
||||
const { scrollStyle: defaultScrollStyle } = usePageScrollHeight({
|
||||
extraBottomPx: props.extraBottomPx ?? 0,
|
||||
})
|
||||
|
||||
const mergedStyle = computed<CSSProperties>(() => props.scrollStyle ?? defaultScrollStyle.value)
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.page-scroll-view {
|
||||
flex-shrink: 0;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user