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 7070 isLoading: false ,
7171 isComplete: false ,
7272 isFirstLoad: true , // save the current loading whether it is the first loading
73- isActivated: true , // save activate status to support keep-alive feature
7473 };
7574 },
7675 computed: {
9493 this .scrollParent = getScrollParent (this .$el );
9594
9695 this .scrollHandler = function scrollHandlerOriginal () {
97- if (! this .isLoading && this . isActivated ) {
96+ if (! this .isLoading ) {
9897 this .attemptLoad ();
9998 }
10099 }.bind (this );
104103
105104 this .$on (' $InfiniteLoading:loaded' , () => {
106105 this .isFirstLoad = false ;
107- if (this .isLoading && this . isActivated ) {
106+ if (this .isLoading ) {
108107 this .$nextTick (this .attemptLoad );
109108 }
110109 });
125124 * To adapt to keep-alive feature, but only work on Vue 2.2.0 and above, see: https://vuejs.org/v2/api/#keep-alive
126125 */
127126 deactivated () {
128- this .isActivated = false ;
127+ this .isLoading = false ;
128+ this .scrollParent .removeEventListener (' scroll' , this .scrollHandler );
129129 },
130130 activated () {
131- this .isActivated = true ;
131+ this .scrollParent . addEventListener ( ' scroll ' , this . scrollHandler ) ;
132132 },
133133 methods: {
134134 attemptLoad () {
You can’t perform that action at this time.
0 commit comments