@@ -105,7 +105,7 @@ defineExpose({
105
105
list: listRef ,
106
106
});
107
107
108
- const { items, loading, pagination, scrollThreshold } = toRefs (props );
108
+ const { items, loading, pagination, scrollThreshold, listOptions } = toRefs (props );
109
109
110
110
const scrolled = ref (false );
111
111
@@ -141,7 +141,23 @@ const onHover = ({ item, hover }: { item: ListScrollItem; hover: boolean }) => {
141
141
const onLoadMore = (payload : { page: number ; pageCount: number ; pageSize: number }) => {
142
142
emits (' onloadMore' , { listRef , ... payload });
143
143
};
144
+
144
145
const isEmpty = computed (() => ! items .value .length && ! loading .value );
146
+ const listItemSize = computed (() => listOptions ?.value ?.itemSize ?? 145 );
147
+
148
+ const topInset = computed (() => {
149
+ const listElementRef = listRef .value ?.$el ;
150
+ if (! listElementRef ) return 0 ;
151
+ const inset = getComputedStyle (listElementRef ).getPropertyValue (
152
+ ' --safe-area-inset-top' ,
153
+ );
154
+ if (! inset ) return 0 ;
155
+ return parseInt (inset , 10 );
156
+ });
157
+ const listPaddingTop = computed (
158
+ () => topInset .value + (listOptions ?.value ?.paddingTop ?? 60 ),
159
+ );
160
+ const listPaddingBottom = computed (() => listOptions ?.value ?.paddingBottom ?? 32 );
145
161
</script >
146
162
147
163
<template >
@@ -152,7 +168,7 @@ const isEmpty = computed(() => !items.value.length && !loading.value);
152
168
class =" list-scroll"
153
169
:data-length =" items.length"
154
170
:data-page-size =" pageSize"
155
- :item-size =" listOptions?.itemSize ?? 145 "
171
+ :item-size =" listItemSize "
156
172
:items =" items"
157
173
:item-resizable =" false"
158
174
ignore-item-resize
@@ -161,8 +177,8 @@ const isEmpty = computed(() => !items.value.length && !loading.value);
161
177
size: 'large',
162
178
...listOptions?.visibleItemsProps,
163
179
}"
164
- :padding-top =" listOptions?.paddingTop ?? 60 "
165
- :padding-bottom =" listOptions?.paddingBottom ?? 32 "
180
+ :padding-top =" listPaddingTop "
181
+ :padding-bottom =" listPaddingBottom "
166
182
:key-field =" 'key'"
167
183
@scroll =" onScrollHandler"
168
184
@vue:updated =" onUpdatedHandler"
@@ -228,7 +244,7 @@ const isEmpty = computed(() => !items.value.length && !loading.value);
228
244
@include animation .fade-in ;
229
245
230
246
.list-scroll {
231
- height : calc (var (--full-height-absolute ) - 8px );
247
+ height : calc (var (--full-height ) - 8px );
232
248
margin-top : calc (0% - #{layout .$safe-navbar-height } );
233
249
margin-bottom : 8px ;
234
250
0 commit comments