瀏覽代碼

:recycle: always loading hero on list page

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

+ 5
- 5
vue-theme/src/pages/list.vue 查看文件

141
             const page = this.allPages.filter(
141
             const page = this.allPages.filter(
142
                 page => page.slug == type + 's',
142
                 page => page.slug == type + 's',
143
             )[0]
143
             )[0]
144
+
144
             let hero = { url: null, heroType: null }
145
             let hero = { url: null, heroType: null }
145
-            
146
+
146
             // Clear the hero and bail
147
             // Clear the hero and bail
147
             if(!page) return this.$store.commit('SET_HERO', hero)
148
             if(!page) return this.$store.commit('SET_HERO', hero)
148
 
149
 
150
+            console.log('setting hero:', page)
149
             hero.url = page.featured
151
             hero.url = page.featured
150
             hero.heroType = 'image'
152
             hero.heroType = 'image'
151
             if (
153
             if (
181
         }
183
         }
182
     },
184
     },
183
     watch: {
185
     watch: {
184
-        posts() {
185
-            this.checkAndSetHero(this.type)
186
-        },
187
         $route(to, from) {
186
         $route(to, from) {
188
-            let type = convertTitleCase(this.type) +'s'
187
+            this.checkAndSetHero(this.type)
188
+            
189
             let sort = to.path
189
             let sort = to.path
190
                 .split('/')
190
                 .split('/')
191
                 .filter(p => p)
191
                 .filter(p => p)

Loading…
取消
儲存