added prev next button to articles

This commit is contained in:
2019-07-14 17:12:18 +02:00
parent ddffd26c77
commit d84750ef8f
3 changed files with 98 additions and 41 deletions

View File

@@ -53,10 +53,21 @@ export default {
})
},
nextPage ({ dispatch, commit, state }, $infiniteLoadingstate) {
console.log("Search nextPage", $infiniteLoadingstate);
console.log("blabla nextPage", $infiniteLoadingstate);
commit('incrementPage')
commit('setInfiniteState', $infiniteLoadingstate)
dispatch('getItems')
},
getItemIndex({ dispatch, commit, state}, uuid) {
return state.items.findIndex((e) =>{
return e.uuid == uuid
})
},
getPrevNextItems({ dispatch, commit, state }, index) {
return {
prev:state.items[index-1],
next:state.items[index+1]
}
}
}
}