File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 17
17
The message heights are unknown.
18
18
</div >
19
19
</template >
20
-
20
+ <template #after >
21
+ <div class =" notice" >
22
+ You have reached the end.
23
+ </div >
24
+ </template >
21
25
<template v-slot =" { item , index , active } " >
22
26
<DynamicScrollerItem
23
27
: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"
@@ -316,6 +318,18 @@ export default {
316
318
scroll .start -= buffer
317
319
scroll .end += buffer
318
320
321
+ // account for leading slot
322
+ if (this .$refs .before ){
323
+ const lead = this .$refs .before .scrollHeight ;
324
+ scroll .start -= lead;
325
+ }
326
+
327
+ // account for trailing slot
328
+ if (this .$refs .after ){
329
+ const trail = this .$refs .after .scrollHeight ;
330
+ scroll .end += trail;
331
+ }
332
+
319
333
// Variable size mode
320
334
if (itemSize === null ) {
321
335
let h
You can’t perform that action at this time.
0 commit comments