浏览代码

:recycle: using sort watcher with type watcher together

tags/0.9.0
J 4 年前
父节点
当前提交
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
         type(newType) {
191
         type(newType) {
192
             if(!postTypes.includes(newType)) return console.warn('Type not valid...')
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
             if(ignore.includes(newType)) return
196
             if(ignore.includes(newType)) return
197
             this.initPostList()
197
             this.initPostList()
198
         },
198
         },
199
+        // Fires when navigating between pages with different sorts
199
         sortBy(newSort) {
200
         sortBy(newSort) {
201
+            // console.log('sort changed :', newSort)
200
             if(!Object.values(sortTypes).includes(newSort)) return
202
             if(!Object.values(sortTypes).includes(newSort)) return
201
             this.initPostList()
203
             this.initPostList()
202
         }
204
         }

+ 1
- 1
vue-theme/src/store/index.js 查看文件

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

正在加载...
取消
保存