File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change 70
70
isLoading: false ,
71
71
isComplete: false ,
72
72
isFirstLoad: true , // save the current loading whether it is the first loading
73
- isActivated: true , // save activate status to support keep-alive feature
74
73
};
75
74
},
76
75
computed: {
94
93
this .scrollParent = getScrollParent (this .$el );
95
94
96
95
this .scrollHandler = function scrollHandlerOriginal () {
97
- if (! this .isLoading && this . isActivated ) {
96
+ if (! this .isLoading ) {
98
97
this .attemptLoad ();
99
98
}
100
99
}.bind (this );
104
103
105
104
this .$on (' $InfiniteLoading:loaded' , () => {
106
105
this .isFirstLoad = false ;
107
- if (this .isLoading && this . isActivated ) {
106
+ if (this .isLoading ) {
108
107
this .$nextTick (this .attemptLoad );
109
108
}
110
109
});
125
124
* To adapt to keep-alive feature, but only work on Vue 2.2.0 and above, see: https://vuejs.org/v2/api/#keep-alive
126
125
*/
127
126
deactivated () {
128
- this .isActivated = false ;
127
+ this .isLoading = false ;
128
+ this .scrollParent .removeEventListener (' scroll' , this .scrollHandler );
129
129
},
130
130
activated () {
131
- this .isActivated = true ;
131
+ this .scrollParent . addEventListener ( ' scroll ' , this . scrollHandler ) ;
132
132
},
133
133
methods: {
134
134
attemptLoad () {
You can’t perform that action at this time.
0 commit comments