3
3
// Definitions by: Phil Scott <https://github.com/enkafan>
4
4
// PeachScript <https://github.com/PeachScript>
5
5
6
- import Vue , { VNode } from 'vue' ;
6
+ import Vue , { VNode , Component } from 'vue' ;
7
7
8
8
export type SpinnerType = 'default' | 'bubbles' | 'circles' | 'spiral' | 'waveDots' ;
9
9
export type DirectionType = 'top' | 'bottom' ;
@@ -12,13 +12,35 @@ export interface Slots {
12
12
spinner : VNode [ ] ;
13
13
'no-result' : VNode [ ] ;
14
14
'no-more' : VNode [ ] ;
15
+ 'error' : VNode [ ] ;
15
16
[ key : string ] : VNode [ ] ;
16
17
}
17
18
18
19
export interface StateChanger {
19
20
loaded ( ) : void ;
20
21
complete ( ) : void ;
21
22
reset ( ) : void ;
23
+ error ( ) : void ;
24
+ }
25
+
26
+ export interface InfiniteOptions {
27
+ props ?: {
28
+ spinner ?: SpinnerType ;
29
+ distance ?: number ;
30
+ forceUseInfiniteWrapper ?: boolean | string ;
31
+ } ;
32
+
33
+ system ?: {
34
+ throttleLimit ?: number ;
35
+ } ;
36
+
37
+ slots ?: {
38
+ noResults ?: string | Component ;
39
+ noMore ?: string | Component ;
40
+ error ?: string | Component ;
41
+ errorBtnText ?: string ;
42
+ spinner ?: string | Component ;
43
+ } ;
22
44
}
23
45
24
46
export default class InfiniteLoading extends Vue {
@@ -32,7 +54,7 @@ export default class InfiniteLoading extends Vue {
32
54
direction : DirectionType ;
33
55
34
56
// Whether find the element which has `infinite-wrapper` attribute as the scroll wrapper
35
- forceUseInfiniteWrapper : boolean ;
57
+ forceUseInfiniteWrapper : boolean | string ;
36
58
37
59
// Infinite event handler
38
60
onInfinite : ( $state : StateChanger ) => void ;
0 commit comments