Преглед на файлове

:recycle: trying to simplify initPost from route watch

tags/0.9.0
J преди 4 години
родител
ревизия
712deba1d8
променени са 1 файла, в които са добавени 3 реда и са изтрити 5 реда
  1. 3
    5
      vue-theme/src/pages/list.vue

+ 3
- 5
vue-theme/src/pages/list.vue Целия файл

127
             }
127
             }
128
 
128
 
129
             let res = null
129
             let res = null
130
-            if(this.pType && !ignore.includes(dispatchAction)) {
130
+            if(this.pType && !ignore.includes(dispatchAction) && this.keepFetching) {
131
                 res = await this.$store.dispatch(dispatchAction, params)
131
                 res = await this.$store.dispatch(dispatchAction, params)
132
             }
132
             }
133
 
133
 
198
             this.loadMorePosts()
198
             this.loadMorePosts()
199
         },
199
         },
200
         routeInfoFromPath(fullPath) {
200
         routeInfoFromPath(fullPath) {
201
-            console.log(fullPath)
202
-            console.log(fullPath.split('/'))
203
-            const [ potentialType, potentialSort ] = fullPath.split('/')
204
-            console.log(potentialType)
201
+            const [ potentialType, potentialSort ] = fullPath.split('/').filter(e =>  e)
205
             return {
202
             return {
206
                 sortBy: Object.values(sortTypes).includes(potentialSort) ? potentialSort : null,
203
                 sortBy: Object.values(sortTypes).includes(potentialSort) ? potentialSort : null,
207
                 type: postTypes.includes(potentialType) ? potentialType : null
204
                 type: postTypes.includes(potentialType) ? potentialType : null
237
             ) {
234
             ) {
238
                 const ignore = ['event', 'exhibition', 'post']
235
                 const ignore = ['event', 'exhibition', 'post']
239
                 if(ignore.includes(this.type)) return
236
                 if(ignore.includes(this.type)) return
237
+                console.log('init from $route watch...')
240
                 this.clearAndInitPostList()
238
                 this.clearAndInitPostList()
241
             }
239
             }
242
         }
240
         }

Loading…
Отказ
Запис