Просмотр исходного кода

:recycle: using sort watcher with type watcher together

tags/0.9.0
J 4 лет назад
Родитель
Сommit
d5192ebe9b
2 измененных файлов: 5 добавлений и 3 удалений
  1. 4
    2
      vue-theme/src/pages/list.vue
  2. 1
    1
      vue-theme/src/store/index.js

+ 4
- 2
vue-theme/src/pages/list.vue Просмотреть файл

@@ -191,12 +191,14 @@ export default {
191 191
         type(newType) {
192 192
             if(!postTypes.includes(newType)) return console.warn('Type not valid...')
193 193
 
194
-            // Ignore types with presorts so the sortBy watcher can handle them
195
-            const ignore = ['event', 'exhibition', 'artist']
194
+            // Ignore some types with presorts so the sortBy watcher can handle them
195
+            const ignore = ['artist']
196 196
             if(ignore.includes(newType)) return
197 197
             this.initPostList()
198 198
         },
199
+        // Fires when navigating between pages with different sorts
199 200
         sortBy(newSort) {
201
+            // console.log('sort changed :', newSort)
200 202
             if(!Object.values(sortTypes).includes(newSort)) return
201 203
             this.initPostList()
202 204
         }

+ 1
- 1
vue-theme/src/store/index.js Просмотреть файл

@@ -40,7 +40,7 @@ const state = {
40 40
 const mutations = {
41 41
     SET_HERO(state, hero) {
42 42
         if (!hero.url) {
43
-            console.warn('No hero to set')
43
+            console.warn('No hero url to set')
44 44
             state.hero.url = null
45 45
             state.hero.type = null
46 46
             state.hero.text = ''

Загрузка…
Отмена
Сохранить