File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed
vue-virtual-scroller/src/components Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 18
18
The message heights are unknown.
19
19
</div >
20
20
</template >
21
-
21
+ <template #after >
22
+ <div class =" notice" >
23
+ You have reached the end.
24
+ </div >
25
+ </template >
22
26
<template #default =" { item , index , active } " >
23
27
<DynamicScrollerItem
24
28
:item =" item"
Original file line number Diff line number Diff line change 12
12
<div
13
13
v-if =" $slots.before"
14
14
class =" vue-recycle-scroller__slot"
15
+ ref =" before"
15
16
>
16
17
<slot
17
18
name =" before"
43
44
<div
44
45
v-if =" $slots.after"
45
46
class =" vue-recycle-scroller__slot"
47
+ ref =" after"
46
48
>
47
49
<slot
48
50
name =" after"
@@ -321,6 +323,18 @@ export default {
321
323
scroll .start -= buffer
322
324
scroll .end += buffer
323
325
326
+ // account for leading slot
327
+ if (this .$refs .before ){
328
+ const lead = this .$refs .before .scrollHeight ;
329
+ scroll .start -= lead;
330
+ }
331
+
332
+ // account for trailing slot
333
+ if (this .$refs .after ){
334
+ const trail = this .$refs .after .scrollHeight ;
335
+ scroll .end += trail;
336
+ }
337
+
324
338
// Variable size mode
325
339
if (itemSize === null ) {
326
340
let h
You can’t perform that action at this time.
0 commit comments