瀏覽代碼

:bug: adjusting route check for single page | #117

tags/0.9.0
J 4 年之前
父節點
當前提交
4c60dbbe7c
共有 1 個文件被更改,包括 2 次插入2 次删除
  1. 2
    2
      vue-theme/src/pages/single.vue

+ 2
- 2
vue-theme/src/pages/single.vue 查看文件

48
 
48
 
49
 import { postTypeGetters, scrollTop, heroUtils } from './mixin-post-types'
49
 import { postTypeGetters, scrollTop, heroUtils } from './mixin-post-types'
50
 
50
 
51
-import { sortTypes, convertTitleCase, dePluralize, typeFromRoute } from '@/utils/helpers'
51
+import { postTypes, sortTypes, convertTitleCase, dePluralize, typeFromRoute } from '@/utils/helpers'
52
 
52
 
53
 const TIMEOUT = 1
53
 const TIMEOUT = 1
54
 
54
 
227
             const hasSort = path.filter(fragment => Object.values(sortTypes).includes(fragment))
227
             const hasSort = path.filter(fragment => Object.values(sortTypes).includes(fragment))
228
             console.log('hasSort :', hasSort)
228
             console.log('hasSort :', hasSort)
229
             console.log('path :', path)
229
             console.log('path :', path)
230
-            if (path.length < 1 && hasSort.length < 1) {
230
+            if (path.length <= 2 && postTypes.includes(path[0]) && hasSort.length < 1) {
231
                 this._clearHero(this.$store)
231
                 this._clearHero(this.$store)
232
                 this.loadPostData()
232
                 this.loadPostData()
233
             }
233
             }

Loading…
取消
儲存