File tree Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Expand file tree Collapse file tree 1 file changed +30
-1
lines changed Original file line number Diff line number Diff line change 11<template >
22 <div class =" infinite-loading-container" >
33 <i class =" icon-loading" v-show =" isLoading" ></i >
4+ <div class =" infinite-status-tips" v-show =" !isLoading && isNoResults" >
5+ <slot name =" no-results" >No results :(</slot >
6+ </div >
7+ <div class =" infinite-status-tips" v-show =" !isLoading && isNoMore" >
8+ <slot name =" no-more" >No more data :)</slot >
9+ </div >
410 </div >
511</template >
612<script >
4147 isLoading: false ,
4248 scrollParent: null ,
4349 scrollHandler: null ,
50+ isNoResults: false ,
51+ isNoMore: false ,
4452 };
4553 },
4654 props: {
7280 ' $InfiniteLoading:loaded' () {
7381 this .isLoading = false ;
7482 },
83+ ' $InfiniteLoading:noResults' () {
84+ this .isLoading = false ;
85+ this .isNoMore = false ;
86+ this .isNoResults = true ;
87+ this .scrollParent .removeEventListener (' scroll' , this .scrollHandler );
88+ },
89+ ' $InfiniteLoading:noMore' () {
90+ this .isLoading = false ;
91+ this .isNoResults = false ;
92+ this .isNoMore = true ;
93+ this .scrollParent .removeEventListener (' scroll' , this .scrollHandler );
94+ },
7595 },
7696 destroyed () {
77- this .scrollParent .removeEventListener (' scroll' , this .scrollHandler );
97+ if (! this .isNoResults && ! this .isNoMore ) {
98+ this .scrollParent .removeEventListener (' scroll' , this .scrollHandler );
99+ }
78100 },
79101 };
80102 </script >
113135 }
114136 }
115137
138+ .infinite-status-tips {
139+ color : #666 ;
140+ font-size : 14px ;
141+ text-align : center ;
142+ padding : 10px 0 ;
143+ }
144+
116145 @keyframes loading{
117146 0% {
118147 transform : rotate (-38deg );
You can’t perform that action at this time.
0 commit comments