File tree Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Expand file tree Collapse file tree 1 file changed +13
-9
lines changed Original file line number Diff line number Diff line change 19
19
border-top : 1px solid # fff ;
20
20
border-bottom : 1px solid # e3e3e3 ;
21
21
}
22
- .example-list-item : before {
22
+ .example-list-item :: before {
23
23
content : 'Line: ' ;
24
24
}
25
25
</ style >
38
38
} ,
39
39
methods : {
40
40
onInfinite : function ( ) {
41
- setTimeout ( function ( ) {
42
- var temp = [ ] ;
43
- for ( var i = this . list . length ; i <= this . list . length + 10 ; i ++ ) {
44
- temp . push ( i ) ;
45
- }
41
+ if ( this . list . length > 200 ) {
42
+ this . $refs . infiniteLoading . $emit ( '$InfiniteLoading:complete' ) ;
43
+ } else {
44
+ setTimeout ( function ( ) {
45
+ var temp = [ ] ;
46
+ for ( var i = this . list . length ; i <= this . list . length + 10 ; i ++ ) {
47
+ temp . push ( i ) ;
48
+ }
46
49
47
- this . list = this . list . concat ( temp ) ;
48
- this . $refs . infiniteLoading . $emit ( '$InfiniteLoading:loaded' ) ;
49
- } . bind ( this ) , 1000 ) ;
50
+ this . list = this . list . concat ( temp ) ;
51
+ this . $refs . infiniteLoading . $emit ( '$InfiniteLoading:loaded' ) ;
52
+ } . bind ( this ) , 1000 ) ;
53
+ }
50
54
}
51
55
}
52
56
} ) ;
You can’t perform that action at this time.
0 commit comments