ソースを参照

:poop: bunch of logs to troubleshoot intersection misfire

tags/0.9.0
J 4年前
コミット
e3763d7294
2個のファイルの変更7行の追加7行の削除
  1. 5
    4
      vue-theme/src/pages/list.vue
  2. 2
    3
      vue-theme/src/utils/helpers.js

+ 5
- 4
vue-theme/src/pages/list.vue ファイルの表示

@@ -47,7 +47,7 @@ export default {
47 47
     data() {
48 48
         return {
49 49
             page: 0,
50
-            perPage: 18,
50
+            perPage: 6,
51 51
             keepFetching: true 
52 52
         }
53 53
     },
@@ -76,7 +76,7 @@ export default {
76 76
             this.$store.commit(`${uppercaseType}_LOADED`)
77 77
         },
78 78
         loadMorePosts() {
79
-            // console.log(this.$route)
79
+            console.log('trying to load for: ', this.$route)
80 80
             const type = typeFromRoute(this.$route)
81 81
             if(!type) return console.warn(`type: ${type} not found...`)
82 82
             if(!this.keepFetching) return console.warn('nothing left to fetch...')
@@ -144,14 +144,15 @@ export default {
144 144
 
145 145
             console.warn('setting up intersection handler for:', this.type)
146 146
             const footerEl = document.querySelector(".footer-wrapper footer")
147
-            console.warn('attach to: ',footerEl)
147
+            // console.warn('attach to: ',footerEl)
148 148
             if(!footerEl) return
149 149
 
150 150
             window.addEventListener("load", e => {
151 151
                 const onIntersection = () => {
152 152
                     console.log('intersected...')
153 153
                     this.loadMorePosts()
154
-                    console.log('loaded morePosts...')
154
+                    console.log('loaded...', this.loadMorePosts)
155
+                    console.log('cb this:', this)
155 156
                 }
156 157
                 const observer = new IntersectionObserver(onIntersection, {
157 158
                     rootMargin: "0px 0px -20px 0px",

+ 2
- 3
vue-theme/src/utils/helpers.js ファイルの表示

@@ -48,12 +48,11 @@ const typeFromRoute = route => {
48 48
             .filter(pathSection => pathSection != '')
49 49
             .filter(pathSection => postTypes.includes(pathSection))
50 50
 
51
-            // Only take the first match
51
+        // Only take the first match
52 52
         type = type[0]
53 53
         // console.log(`type derived from route.pajth: ${type}`)
54 54
     }
55
-    
56
-    console.log('type from route:',type)
55
+    // console.log('type from route:',type)
57 56
     return type
58 57
 }
59 58
 

読み込み中…
キャンセル
保存