Kaynağa Gözat

:recycle: flipping route watcher on single page

tags/0.9.0
J 4 yıl önce
ebeveyn
işleme
ae6e91bdbf
1 değiştirilmiş dosya ile 2 ekleme ve 3 silme
  1. 2
    3
      vue-theme/src/pages/single.vue

+ 2
- 3
vue-theme/src/pages/single.vue Dosyayı Görüntüle

223
     },
223
     },
224
     watch: {
224
     watch: {
225
         $route(to, from) {
225
         $route(to, from) {
226
-            // Only load post data when
227
-            //  navigating TO a single page
226
+            // Only load post data when navigating TO a single page
228
             const path = to.fullPath.split('/').filter(p => p)
227
             const path = to.fullPath.split('/').filter(p => p)
229
             const hasSort = path.filter(fragment => Object.values(sortTypes).includes(fragment))
228
             const hasSort = path.filter(fragment => Object.values(sortTypes).includes(fragment))
230
             console.log('hasSort :', hasSort)
229
             console.log('hasSort :', hasSort)
231
             console.log('path :', path)
230
             console.log('path :', path)
232
-            if (path.length <= 2 && postTypes.includes(path[0]) && hasSort.length < 1) {
231
+            if (path.length >= 2 && postTypes.includes(path[0]) && hasSort.length < 1) {
233
                 this._clearHero(this.$store)
232
                 this._clearHero(this.$store)
234
                 this.loadPostData()
233
                 this.loadPostData()
235
             }
234
             }

Loading…
İptal
Kaydet