1
1
<template >
2
2
<component
3
+ v-observe-visibility =" handleVisibilityChange"
3
4
:is =" mainTag"
4
- class =" virtual-scroller"
5
5
:class =" cssClass"
6
+ class =" virtual-scroller"
6
7
@scroll.passive =" handleScroll"
7
- v-observe-visibility =" handleVisibilityChange"
8
8
>
9
9
<slot
10
10
name =" before-container"
11
11
/>
12
12
<component
13
13
ref =" itemContainer"
14
14
:is =" containerTag"
15
- class =" item-container"
16
15
:class =" containerClass"
17
16
:style =" itemContainerStyle"
17
+ class =" item-container"
18
18
>
19
19
<slot
20
20
name =" before-content"
21
21
/>
22
22
<component
23
23
ref =" items"
24
24
:is =" contentTag"
25
- class =" items"
26
25
:class =" contentClass"
27
26
:style =" itemsStyle"
27
+ class =" items"
28
28
>
29
29
<template v-if =" renderers " >
30
30
<component
31
- class =" item"
32
31
v-for =" (item, index) in visibleItems"
33
32
:key =" keysEnabled && item[keyField] || undefined"
34
33
:is =" renderers[item[typeField]]"
35
34
:item =" item"
36
35
:item-index =" $_startIndex + index"
36
+ class =" item"
37
37
/>
38
38
</template >
39
39
<template v-else >
40
40
<slot
41
- class =" item"
42
41
v-for =" (item, index) in visibleItems"
43
42
:item =" item"
44
43
:item-index =" $_startIndex + index"
45
44
:item-key =" keysEnabled && item[keyField] || undefined"
45
+ class =" item"
46
46
/>
47
47
</template >
48
48
</component >
@@ -62,14 +62,15 @@ import Scroller from '../mixins/scroller'
62
62
import config from ' ../config'
63
63
64
64
export default {
65
- name: ' virtual-scroller ' ,
65
+ name: ' VirtualScroller ' ,
66
66
67
67
mixins: [
68
68
Scroller,
69
69
],
70
70
71
71
props: {
72
72
renderers: {
73
+ type: Object ,
73
74
default: null ,
74
75
},
75
76
keyField: {
@@ -85,13 +86,15 @@ export default {
85
86
default: ' div' ,
86
87
},
87
88
containerClass: {
89
+ type: [String , Array , Object ],
88
90
default: null ,
89
91
},
90
92
contentTag: {
91
93
type: String ,
92
94
default: ' div' ,
93
95
},
94
96
contentClass: {
97
+ type: [String , Array , Object ],
95
98
default: null ,
96
99
},
97
100
poolSize: {
0 commit comments