added prev next button to articles
This commit is contained in:
@@ -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]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user