소스 검색

:recycle: setting intersection loader with any init

tags/0.9.0
J 4 년 전
부모
커밋
acdbb29e84
1개의 변경된 파일6개의 추가작업 그리고 19개의 파일을 삭제
  1. 6
    19
      vue-theme/src/pages/list.vue

+ 6
- 19
vue-theme/src/pages/list.vue 파일 보기

195
             // Clear any preloaded posts (from home, etc.)
195
             // Clear any preloaded posts (from home, etc.)
196
             this.clearAllPosts()
196
             this.clearAllPosts()
197
             this.loadMorePosts()
197
             this.loadMorePosts()
198
-        },
199
-        routeInfoFromPath(fullPath) {
200
-            const [ potentialType, potentialSort ] = fullPath.split('/').filter(e =>  e)
201
-            return {
202
-                sortBy: Object.values(sortTypes).includes(potentialSort) ? potentialSort : null,
203
-                type: postTypes.includes(potentialType) ? potentialType : null
198
+
199
+            // Always unset and reset the intersection loader
200
+            this.unsetIntersectionLoader()
201
+            if(!toPathInfo.sortBy != sortTypes.material) {
202
+                this.setIntersectionLoader()
204
             }
203
             }
205
         }
204
         }
206
     },
205
     },
212
 
211
 
213
             console.log('init from type watch...')
212
             console.log('init from type watch...')
214
             this.clearAndInitPostList()
213
             this.clearAndInitPostList()
215
-        },
216
-        $route(to, from) {
217
-            console.log('---')
218
-            const toPathInfo = this.routeInfoFromPath(to.fullPath)
219
-            const fromPathInfo = this.routeInfoFromPath(from.fullPath)
220
-            console.log('to :', toPathInfo)
221
-            console.log('from :', fromPathInfo)
222
-            
223
-            // Always unset and reset the intersection loader
224
-            this.unsetIntersectionLoader()
225
-            if(!toPathInfo.sortBy != sortTypes.material) {
226
-                this.setIntersectionLoader()
227
-            }
228
         }
214
         }
229
     },
215
     },
230
     mounted() {
216
     mounted() {
231
         console.log('init from mounted...')
217
         console.log('init from mounted...')
218
+        // This only fires navigating from a single page, to a list page
232
         this.clearAndInitPostList()
219
         this.clearAndInitPostList()
233
     },
220
     },
234
     beforeDestroy() {
221
     beforeDestroy() {

Loading…
취소
저장