Pārlūkot izejas kodu

:bug: calling oberserve on setup

tags/0.9.0
J 4 gadus atpakaļ
vecāks
revīzija
6480acbc79
1 mainītis faili ar 4 papildinājumiem un 3 dzēšanām
  1. 4
    3
      vue-theme/src/pages/list.vue

+ 4
- 3
vue-theme/src/pages/list.vue Parādīt failu

149
             // console.warn('attach to: ',footerEl)
149
             // console.warn('attach to: ',footerEl)
150
             if(!footerEl) return
150
             if(!footerEl) return
151
             const onIntersect = entries => {
151
             const onIntersect = entries => {
152
-                if(this.isFetching) return
152
+                // if(this.isFetching) return
153
 
153
 
154
-                this.isFetching = true
154
+                // this.isFetching = true
155
                 entries.forEach(({ target, isIntersecting }) => {
155
                 entries.forEach(({ target, isIntersecting }) => {
156
                     if (!isIntersecting) return
156
                     if (!isIntersecting) return
157
                     this.observer.unobserve(target)
157
                     this.observer.unobserve(target)
160
                         console.log("intersected:", target)
160
                         console.log("intersected:", target)
161
                     }, 1000)
161
                     }, 1000)
162
                 })
162
                 })
163
-                this.isFetching = false
163
+                // this.isFetching = false
164
                 // this.loadMorePosts()
164
                 // this.loadMorePosts()
165
                 // console.log('loaded...', this.loadMorePosts)
165
                 // console.log('loaded...', this.loadMorePosts)
166
                 // console.log('cb this:', this)
166
                 // console.log('cb this:', this)
172
                     threshold: 1.0,
172
                     threshold: 1.0,
173
                 }
173
                 }
174
             )
174
             )
175
+            this.observer.observe(footerEl)
175
         },
176
         },
176
         unsetIntersectionLoader(type) {
177
         unsetIntersectionLoader(type) {
177
             if(!type) return console.error('cannot unset intersection handler for undefined type...')
178
             if(!type) return console.error('cannot unset intersection handler for undefined type...')

Notiek ielāde…
Atcelt
Saglabāt